Using Releases you can easily resolve all released versions from a Git repository, in either a Swift script or command line tool. It supports both remote & local repositories and provides convenience APIs for sorting, filtering out pre-released versions, etc.
Simply call Releases.versions(for: url)
and you'll get an array of Version
back:
let url = URL(string: "https://github.com/johnsundell/unbox")!
let releases = Releases.versions(for: url)
// Print the latest version
print(releases.last)
Remove all pre-release versions (like Alpha
, Beta
, etc):
let url = URL(string: "https://github.com/johnsundell/unbox)!
let releases = Releases.versions(for: url).withoutPreReleases()
// Print the latest stable version
print(releases.last)
- Install Marathon.
- Add Releases to Marathon using
$ marathon add https://github.com/JohnSundell/Releases.git
. - Alternatively, add
https://github.com/JohnSundell/Releases.git
to yourMarathonfile
. - Write your script, then run it using
$ marathon run yourScript.swift
.
- Add
.package(url: "https://github.com/JohnSundell/Releases.git", from: "2.0.0")
to yourPackage.swift
file'sdependencies
. - Update your packages using
$ swift package update
.
- Open an issue if you need help, if you found a bug, or if you want to discuss a feature request.
- Open a PR if you want to make some change to Releases.
- Contact @johnsundell on Twitter for discussions, news & announcements about Releases & other projects.