🚢 版本发布

使用 Releases,您可以轻松解析 Git 仓库中的所有已发布版本,无论是在 Swift 脚本还是命令行工具中。它支持远程和本地仓库,并提供方便的 API 用于排序、过滤掉预发布版本等。

用法

只需调用 Releases.versions(for: url),您将获得一个 Version 数组

let url = URL(string: "https://github.com/johnsundell/unbox")!
let releases = Releases.versions(for: url)

// Print the latest version
print(releases.last)

移除所有预发布版本(例如 AlphaBeta 等)

let url = URL(string: "https://github.com/johnsundell/unbox)!
let releases = Releases.versions(for: url).withoutPreReleases()

// Print the latest stable version
print(releases.last)

安装

需要帮助、反馈或建议?