|
7 | 7 | # ===----------------------------------------------------------------------===
|
8 | 8 |
|
9 | 9 | # This script is meant to be sourced from another script that sets the
|
10 |
| -# BUILD_VERSION environment variable to one of "release", "devel", or "trunk" |
| 10 | +# BUILD_SCHEME environment variable to one of "release", "swift-VERSION-branch", or "development" |
11 | 11 | # and will set check the latest builds for each build type in order
|
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 | 15 | OS=$(echo $HOST_OS | tr -d '.')
|
16 | 16 |
|
17 |
| -case "${BUILD_VERSION}" in |
| 17 | +case "${BUILD_SCHEME}" in |
18 | 18 | release)
|
19 | 19 | # e.g., "swift-6.1-RELEASE"
|
20 | 20 | SWIFT_TAG=$(curl -fsSL https://www.swift.org/api/v1/install/releases.json | jq -r '.[-1].tag')
|
21 | 21 | # e.g., "swift-6.1-release"
|
22 | 22 | SWIFT_BRANCH=$(echo "${SWIFT_TAG}" | tr '[A-Z]' '[a-z]')
|
23 | 23 | ;;
|
24 |
| - devel) |
| 24 | + swift-*-branch) |
25 | 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 ' ') |
27 |
| - SWIFT_BRANCH="swift-$(echo $SWIFT_TAG | cut -d- -f2)-branch" |
| 26 | + SWIFT_TAG=$(curl -fsSL https://download.swift.org/$BUILD_SCHEME/$OS/latest-build.yml | grep '^dir: ' | cut -f 2 -d ' ') |
| 27 | + SWIFT_BRANCH=$BUILD_SCHEME |
28 | 28 | ;;
|
29 |
| - trunk) |
| 29 | + development) |
30 | 30 | # e.g., swift-DEVELOPMENT-SNAPSHOT-2025-05-14-a
|
31 | 31 | SWIFT_TAG=$(curl -fsSL https://download.swift.org/development/$OS/latest-build.yml | grep '^dir: ' | cut -f 2 -d ' ')
|
32 | 32 | SWIFT_BRANCH="development"
|
33 | 33 | ;;
|
34 | 34 | *)
|
35 |
| - echo "$0: invalid BUILD_VERSION=${BUILD_VERSION}" |
| 35 | + echo "$0: invalid BUILD_SCHEME=${BUILD_SCHEME}" |
36 | 36 | exit 1
|
37 | 37 | ;;
|
38 | 38 | esac
|
|
0 commit comments