Skip to content

Commit

Permalink
Support upcoming release snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikolai Guyot committed Jan 29, 2022
1 parent df9734a commit 42eecce
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-18.04, ubuntu-20.04, macos-latest]
swift: [5.5, swift-DEVELOPMENT-SNAPSHOT-2022-01-09-a]
swift: [5.5, swift-DEVELOPMENT-SNAPSHOT-2022-01-09-a, swift-5.6-DEVELOPMENT-SNAPSHOT-2022-01-09-a]
include:
- swift: 5.5
expected-version-string: "Swift version 5.5 (swift-5.5-RELEASE)"
- swift: swift-DEVELOPMENT-SNAPSHOT-2022-01-09-a
expected-version-string: "Swift version 5.6-dev (LLVM 7b20e61dd04138a, Swift 9438cf6b2e83c5f)"
- swift: swift-5.6-DEVELOPMENT-SNAPSHOT-2022-01-09-a
expected-version-string: "Swift version 5.6-dev (LLVM 143f1389db63309, Swift 00f7685e0968cbb)"
runs-on: ${{ matrix.os }}

steps:
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ This action allows installing Swift toolchains, with support for both release an

### Inputs

- `version` - The Swift version you want to install. This may either be a release version like `5.5`, or a development
snapshot like `swift-DEVELOPMENT-SNAPSHOT-2021-11-12-a`.
- `version` - The Swift version you want to install. This may either be a release version like `5.5`, a trunk
development snapshot like `swift-DEVELOPMENT-SNAPSHOT-2021-11-12-a`, or a snapshot of the upcoming release, e.g.
`swift-5.6-DEVELOPMENT-SNAPSHOT-2022-01-09-a`.

### Example

Expand Down Expand Up @@ -37,7 +38,7 @@ jobs:
name: Run Tests
strategy:
matrix:
swift: [5.5, swift-DEVELOPMENT-SNAPSHOT-2021-11-12-a]
swift: [5.5, swift-DEVELOPMENT-SNAPSHOT-2021-11-12-a, swift-5.6-DEVELOPMENT-SNAPSHOT-2022-01-09-a]
os: [ubuntu-18.04, ubuntu-20.04, macos-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
Expand Down
13 changes: 12 additions & 1 deletion install-swift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,20 @@ install_toolchain () {
# https://download.swift.org/swift-5.5.2-release/ubuntu1804/swift-5.5.2-RELEASE/swift-5.5.2-RELEASE-ubuntu18.04.tar.gz
# https://download.swift.org/swift-5.5.2-release/ubuntu2004/swift-5.5.2-RELEASE/swift-5.5.2-RELEASE-ubuntu20.04.tar.gz

# Example development snapshot URLs
# Example trunk development snapshot URLs
# https://download.swift.org/development/xcode/swift-DEVELOPMENT-SNAPSHOT-2022-01-09-a/swift-DEVELOPMENT-SNAPSHOT-2022-01-09-a-osx.pkg
# https://download.swift.org/development/ubuntu1804/swift-DEVELOPMENT-SNAPSHOT-2022-01-09-a/swift-DEVELOPMENT-SNAPSHOT-2022-01-09-a-ubuntu18.04.tar.gz
# https://download.swift.org/development/ubuntu1804/swift-DEVELOPMENT-SNAPSHOT-2022-01-09-a/swift-DEVELOPMENT-SNAPSHOT-2022-01-09-a-ubuntu18.04.tar.gz.sig
# https://download.swift.org/development/ubuntu2004/swift-DEVELOPMENT-SNAPSHOT-2022-01-09-a/swift-DEVELOPMENT-SNAPSHOT-2022-01-09-a-ubuntu20.04.tar.gz
# https://download.swift.org/development/ubuntu2004/swift-DEVELOPMENT-SNAPSHOT-2022-01-09-a/swift-DEVELOPMENT-SNAPSHOT-2022-01-09-a-ubuntu20.04.tar.gz.sig

# Example version-specific development snapshot URLs
# https://download.swift.org/swift-5.6-branch/xcode/swift-5.6-DEVELOPMENT-SNAPSHOT-2022-01-11-a/swift-5.6-DEVELOPMENT-SNAPSHOT-2022-01-11-a-osx.pkg
# https://download.swift.org/swift-5.6-branch/ubuntu1804/swift-5.6-DEVELOPMENT-SNAPSHOT-2022-01-11-a/swift-5.6-DEVELOPMENT-SNAPSHOT-2022-01-11-a-ubuntu18.04.tar.gz
# https://download.swift.org/swift-5.6-branch/ubuntu1804/swift-5.6-DEVELOPMENT-SNAPSHOT-2022-01-11-a/swift-5.6-DEVELOPMENT-SNAPSHOT-2022-01-11-a-ubuntu18.04.tar.gz.sig
# https://download.swift.org/swift-5.6-branch/ubuntu2004/swift-5.6-DEVELOPMENT-SNAPSHOT-2022-01-11-a/swift-5.6-DEVELOPMENT-SNAPSHOT-2022-01-11-a-ubuntu20.04.tar.gz
# https://download.swift.org/swift-5.6-branch/ubuntu2004/swift-5.6-DEVELOPMENT-SNAPSHOT-2022-01-11-a/swift-5.6-DEVELOPMENT-SNAPSHOT-2022-01-11-a-ubuntu20.04.tar.gz.sig

toolchain_path () {
if [ $IS_LINUX ]; then
echo $(toolchains_path)/$(release_name)
Expand All @@ -142,6 +149,8 @@ toolchains_path () {
release_name () {
if [[ $SWIFT_VERSION == swift-DEVELOPMENT-SNAPSHOT* ]]; then
RELEASE_NAME=$SWIFT_VERSION
elif [[ $SWIFT_VERSION == swift-*-DEVELOPMENT-SNAPSHOT-* ]]; then
RELEASE_NAME=$SWIFT_VERSION
else
RELEASE_NAME=swift-$SWIFT_VERSION-RELEASE
fi
Expand Down Expand Up @@ -173,6 +182,8 @@ download_url () {

if [[ $SWIFT_VERSION == swift-DEVELOPMENT-SNAPSHOT* ]]; then
FOLDER=development
elif [[ $SWIFT_VERSION =~ swift-(.*)-DEVELOPMENT-SNAPSHOT-.* ]]; then
FOLDER=swift-${BASH_REMATCH[1]}-branch
else
FOLDER=swift-$SWIFT_VERSION-release
fi
Expand Down

0 comments on commit 42eecce

Please sign in to comment.