diff --git a/README.md b/README.md index 1c1a0d29..24ec47f5 100644 --- a/README.md +++ b/README.md @@ -14,10 +14,10 @@ $ heroku create --buildpack vapor/vapor $ git push heroku master remote: -----> Swift app detected -remote: -----> Using Swift 5.8.1 (default) -remote: -----> Using built-in clang (Swift 5.8.1) +remote: -----> Using Swift 5.9 (default) +remote: -----> Using built-in clang (Swift 5.9) remote: -----> Installing swiftenv -remote: -----> Installing Swift 5.8.1 +remote: -----> Installing Swift 5.9 ... ``` @@ -50,22 +50,22 @@ web: Run --env=production --port=$PORT ### Specify a Swift version -The buildpack defaults to Swift 5.8.1 and will be updated when new Swift versions are released. +The buildpack defaults to Swift 5.9 and will be updated when new Swift versions are released. If you need to use a specific version of the Swift toolchain, including older versions – for example Swift 4.2.x to retain compatibility with Swift 3 projects, or a previous version as you run into issues with the latest – you can pin any version number using a file called `.swift-version` in the root of the project folder, or by setting a `SWIFT_VERSION` configuration variable on Heroku, then deploying again. ```shell -$ echo '5.7.3' > .swift-version +$ echo '5.8.1' > .swift-version $ git add .swift-version -$ git commit -m "Pin Swift version to 5.7.3" +$ git commit -m "Pin Swift version to 5.8.1" $ git push heroku main ``` Or: ```shell -$ heroku config:set SWIFT_VERSION=5.7.3 -$ git commit -m "Pin Swift version to 5.7.3" --allow-empty +$ heroku config:set SWIFT_VERSION=5.8.1 +$ git commit -m "Pin Swift version to 5.8.1" --allow-empty $ git push heroku main ``` diff --git a/bin/compile b/bin/compile index bcf534f9..98d023a9 100755 --- a/bin/compile +++ b/bin/compile @@ -13,7 +13,7 @@ ENV_DIR=$3 CLANG_VERSION=7.0.1 -SWIFT_VERSION="5.8.1" +SWIFT_VERSION="5.9" SWIFT_BUILD_CONFIGURATION="release" SWIFT_BUILD_FLAGS="" diff --git a/swiftenv/share/swiftenv-install/5.9 b/swiftenv/share/swiftenv-install/5.9 new file mode 100644 index 00000000..b3701341 --- /dev/null +++ b/swiftenv/share/swiftenv-install/5.9 @@ -0,0 +1,38 @@ +case "$PLATFORM" in + 'osx' ) + URL="https://swift.org/builds/swift-5.9-release/xcode/swift-5.9-RELEASE/swift-5.9-RELEASE-osx.pkg" + ;; + + 'ubuntu14.04' ) + echo + echo " ! Swift 5.9 does not support Ubuntu 14.04." + echo " ! Please upgrade your stack using the 'heroku stack:set' command or via the dashboard." + echo " ! If that is not an option, pin an older version of Swift." + echo + exit 1 + ;; + + 'ubuntu16.04' ) + echo + echo " ! Swift 5.9 does not support Ubuntu 16.04." + echo " ! Please upgrade your stack using the 'heroku stack:set' command or via the dashboard." + echo " ! If that is not an option, pin an older version of Swift." + echo + exit 1 + ;; + + 'ubuntu18.04' ) + URL="https://swift.org/builds/swift-5.9-release/ubuntu1804/swift-5.9-RELEASE/swift-5.9-RELEASE-ubuntu18.04.tar.gz" + ;; + + 'ubuntu20.04' ) + URL="https://swift.org/builds/swift-5.9-release/ubuntu2004/swift-5.9-RELEASE/swift-5.9-RELEASE-ubuntu20.04.tar.gz" + ;; + + 'ubuntu22.04' ) + URL="https://swift.org/builds/swift-5.9-release/ubuntu2204/swift-5.9-RELEASE/swift-5.9-RELEASE-ubuntu22.04.tar.gz" + ;; + + * ) + ;; +esac