12
12
# to provide information about the Swift tag name in use and where to
13
13
# obtain the latest toolchain for building.
14
14
15
- # TODO: we could instead use the latest-build.yml files for this, like:
16
- # https://download.swift.org/swift-6.2-branch/ubuntu2404/latest-build.yml
17
- # https://download.swift.org/development/ubuntu2404/latest-build.yml
18
- # but there doesn't seem to be one for the current release build.
15
+ OS=$( echo $HOST_OS | tr -d ' .' )
19
16
20
17
case " ${BUILD_VERSION} " in
21
18
release)
22
- LATEST_TOOLCHAIN_VERSION=$( curl -sL https://github.com/swiftlang/swift/releases | grep -m1 swift-6.1 | cut -d- -f2)
23
- SWIFT_TAG=" swift-${LATEST_TOOLCHAIN_VERSION} -RELEASE"
24
- SWIFT_BRANCH=" swift-$( echo $SWIFT_TAG | cut -d- -f2) -release"
19
+ # e.g., "swift-6.1-RELEASE"
20
+ SWIFT_TAG=$( curl -fsSL https://www.swift.org/api/v1/install/releases.json | jq -r ' .[-1].tag' )
21
+ # e.g., "swift-6.1-release"
22
+ SWIFT_BRANCH=$( echo " ${SWIFT_TAG} " | tr ' [A-Z]' ' [a-z]' )
25
23
;;
26
24
devel)
27
- LATEST_TOOLCHAIN_VERSION= $( curl -sL https://github.com/swiftlang/swift/tags | grep -m1 swift-6.2-DEV | cut -d- -f8-10 )
28
- SWIFT_TAG=" swift-6.2-DEVELOPMENT-SNAPSHOT- ${LATEST_TOOLCHAIN_VERSION} -a "
25
+ # e.g., swift-6.2-DEVELOPMENT-SNAPSHOT-2025-05-15-a
26
+ SWIFT_TAG=$( curl -fsSL https://download. swift.org/swift -6.2-branch/ $OS /latest-build.yml | grep ' ^dir: ' | cut -f 2 -d ' '
29
27
SWIFT_BRANCH=" swift-$( echo $SWIFT_TAG | cut -d- -f2) -branch"
30
28
;;
31
29
trunk)
32
- LATEST_TOOLCHAIN_VERSION= $( curl -sL https://github.com/swiftlang/swift/tags | grep -m1 swift-DEV | cut -d- -f7-9 )
33
- SWIFT_TAG=" swift-DEVELOPMENT-SNAPSHOT- ${LATEST_TOOLCHAIN_VERSION} -a "
30
+ # e.g., swift-DEVELOPMENT-SNAPSHOT-2025-05-14-a
31
+ SWIFT_TAG=$( curl -fsSL https://download. swift.org/development/ $OS /latest-build.yml | grep ' ^dir: ' | cut -f 2 -d ' ' )
34
32
SWIFT_BRANCH=" development"
35
33
;;
36
34
* )
@@ -40,5 +38,5 @@ case "${BUILD_VERSION}" in
40
38
esac
41
39
42
40
SWIFT_BASE=$SWIFT_TAG -$HOST_OS
43
- export SWIFT_TOOLCHAIN_URL=" https://download.swift.org/$SWIFT_BRANCH /$( echo $HOST_OS | tr -d ' . ' ) /$SWIFT_TAG /$SWIFT_BASE .tar.gz"
41
+ export SWIFT_TOOLCHAIN_URL=" https://download.swift.org/$SWIFT_BRANCH /$OS /$SWIFT_TAG /$SWIFT_BASE .tar.gz"
44
42
0 commit comments