This action provides the following functionality for GitHub Actions users:
- Installing a version of Swift and (by default) adding it to the PATH
See action.yml
Swift
steps:
- uses: actions/checkout@v3
- uses: hdtls/setup-swift@main
with:
swift-version: '5.7.1'
- run: swift --version
The swift-version
input is required.
The action will first check the local tool cache for a semver match. If unable to find a specific version in the tool cache, the action will attempt to download a version of Swift from Swift Releases.
The swift-version
input supports the Semantic Versioning Specification and some special version notations (e.g. swift-x.y-RELEASE
, nightly
, nightly-x.y
, etc.), for detailed examples please refer to the section: Using swift-version input of the Advanced usage guide.
The scripts and documentation in this project are released under the MIT License.
Contributions are welcome!