13
13
# obtain the latest toolchain for building.
14
14
15
15
OS=$( echo $HOST_OS | tr -d ' .' )
16
+ # e.g., "swift-6.1-RELEASE"
17
+ # there is no latest-build.yml for releases, so we need to get it from the API
18
+ export RELEASE_TAG=$( curl -fsSL https://www.swift.org/api/v1/install/releases.json | jq -r ' .[-1].tag' )
19
+ # e.g., "swift-6.1-release"
20
+ export RELEASE_BRANCH=$( echo " ${SWIFT_TAG} " | tr ' [A-Z]' ' [a-z]' )
16
21
17
22
case " ${BUILD_SCHEME} " in
18
23
release)
19
- # e.g., "swift-6.1-RELEASE"
20
- # there is no latest-build.yml for releases, so we need to get it from the API
21
- export SWIFT_TAG=$( curl -fsSL https://www.swift.org/api/v1/install/releases.json | jq -r ' .[-1].tag' )
22
- # e.g., "swift-6.1-release"
23
- export SWIFT_BRANCH=$( echo " ${SWIFT_TAG} " | tr ' [A-Z]' ' [a-z]' )
24
+ export SWIFT_TAG=$RELEASE_TAG
25
+ export SWIFT_BRANCH=$RELEASE_BRANCH
24
26
;;
25
27
development|swift-* -branch)
26
28
# e.g., swift-6.2-DEVELOPMENT-SNAPSHOT-2025-05-15-a
@@ -35,8 +37,11 @@ case "${BUILD_SCHEME}" in
35
37
esac
36
38
37
39
SWIFT_BASE=$SWIFT_TAG -$HOST_OS
38
- if [[ " ${BUILD_SCHEME} " == " development" ]]; then
39
- export SWIFT_TOOLCHAIN_URL=" https://download.swift.org/$SWIFT_BRANCH /$OS /swift-DEVELOPMENT-SNAPSHOT-2025-06-12-a/swift-DEVELOPMENT-SNAPSHOT-2025-06-12-a-$HOST_OS .tar.gz"
40
- else
41
- export SWIFT_TOOLCHAIN_URL=" https://download.swift.org/$SWIFT_BRANCH /$OS /$SWIFT_TAG /$SWIFT_BASE .tar.gz"
42
- fi
40
+ case $BUILD_COMPILER in
41
+ 1|true|yes|YES)
42
+ export SWIFT_TOOLCHAIN_URL=" https://download.swift.org/$RELEASE_BRANCH /$OS /$RELEASE_TAG /$RELEASE_TAG -$HOST_OS .tar.gz"
43
+ ;;
44
+ * )
45
+ export SWIFT_TOOLCHAIN_URL=" https://download.swift.org/$SWIFT_BRANCH /$OS /$SWIFT_TAG /$SWIFT_BASE .tar.gz"
46
+ ;;
47
+ esac
0 commit comments