Swiftpack.co - Package - JohnSundell/Releases

🚢 Releases

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.

Usage

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)

Installation

For scripts

  • Install Marathon.
  • Add Releases to Marathon using $ marathon add https://github.com/JohnSundell/Releases.git.
  • Alternatively, add https://github.com/JohnSundell/Releases.git to your Marathonfile.
  • Write your script, then run it using $ marathon run yourScript.swift.

For command line tools

  • Add .package(url: "https://github.com/JohnSundell/Releases.git", from: "2.0.0") to your Package.swift file's dependencies.
  • Update your packages using $ swift package update.

Help, feedback or suggestions?

  • 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.

Github

link
Stars: 14
Help us keep the lights on

Releases

2.0.1 - Nov 5, 2017

Releases now uses ShellOut version 2.0.0

View build details and download artifacts on buddybuild: Releases (iOS, Releases - Debug)

2.0.0 - Nov 4, 2017

Releases now uses Swift 4.

View build details and download artifacts on buddybuild: Releases (iOS, Releases - Debug)

1.0.6 - May 15, 2017

Releases now uses HTTPS to clone all of its dependencies, instead of SSH.

1.0.5 - May 1, 2017

This release patches a bug that would cause a version’s string to be different when accessed after parsing it using Version.string. For example; a version parsed from the string "3.0" would have the string "3.0.0". This has now been fixed, in order to support a 1:1 relationship with git tags.

1.0.4 - May 1, 2017

Version prefixes (like v3.2.1) are now supported. Version now has a prefix property, and tags containing prefixes are now parsed correctly.