@@ -136,8 +136,9 @@ runs:
136
136
#LATEST_RELEASE=$(curl -fsSL -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" --retry 10 --retry-max-time 600 https://api.github.com/repos/skiptools/swift-android-toolchain/releases/latest | jq -r '.tag_name')
137
137
138
138
# fetch the Atom feed for the latest releases
139
- curl -fsSL --retry 8 --retry-connrefused https://github.com/skiptools/swift-android-toolchain/releases.atom --output ~/swift-releases.xml
140
- yq -oy '.feed.entry[].title' ~/swift-releases.xml | sort -rn > ~/swift-versions.txt
139
+ curl -fsSL --retry 8 --retry-connrefused https://github.com/skiptools/swift-android-toolchain/releases.atom --output ${{ runner.temp }}/swift-releases.xml
140
+ SWIFT_VERSIONS_FILE=${{ runner.temp }}/swift-versions.txt
141
+ yq -oy '.feed.entry[].title' ${{ runner.temp }}/swift-releases.xml | sort -rn > ${SWIFT_VERSIONS_FILE}
141
142
142
143
# if we hardcode the latest builds, we would need to update them every time a new snapshot is released
143
144
@@ -148,20 +149,20 @@ runs:
148
149
#LATEST_RELEASE="6.0.3"
149
150
#SWIFT_VERSION="${LATEST_RELEASE}"
150
151
# use the latest non-snapshot release
151
- SWIFT_VERSION=$(cat ~/swift-versions.txt | grep -v -- '-SNAPSHOT' | head -n 1)
152
+ SWIFT_VERSION=$(cat ${SWIFT_VERSIONS_FILE} | grep -v -- '-SNAPSHOT' | head -n 1)
152
153
elif [[ "${SWIFT_VERSION}" == 'snapshot' ]]; then
153
154
#LATEST_SNAPSHOT="6.1-DEVELOPMENT-SNAPSHOT-2025-03-07-a"
154
155
#SWIFT_VERSION="${LATEST_SNAPSHOT}"
155
156
# use the latest snapshot release
156
- SWIFT_VERSION=$(cat ~/swift-versions.txt | grep -- '-SNAPSHOT' | head -n 1)
157
+ SWIFT_VERSION=$(cat ${SWIFT_VERSIONS_FILE} | grep -- '-SNAPSHOT' | head -n 1)
157
158
elif [[ "${SWIFT_VERSION}" == nightly-* ]]; then
158
159
# e.g., nightly-6.1 will match 6.1-DEVELOPMENT-SNAPSHOT-*
159
160
SWIFT_VERSION=$(echo ${SWIFT_VERSION} | sed 's;nightly-;;g')
160
- SWIFT_VERSION=$(cat ~/swift-versions.txt | grep -- "${SWIFT_VERSION}-SNAPSHOT" | head -n 1)
161
+ SWIFT_VERSION=$(cat ${SWIFT_VERSIONS_FILE} | grep -- "${SWIFT_VERSION}-SNAPSHOT" | head -n 1)
161
162
else
162
163
# match "6.0" to "6.0.3"
163
164
# match "6.1" to "6.1-DEVELOPMENT-SNAPSHOT-2025-03-07-a"
164
- SWIFT_VERSION=$(cat ~/swift-versions.txt | grep -- "^${SWIFT_VERSION}" | head -n 1)
165
+ SWIFT_VERSION=$(cat ${SWIFT_VERSIONS_FILE} | grep -- "^${SWIFT_VERSION}" | head -n 1)
165
166
fi
166
167
167
168
if [[ "${SWIFT_VERSION}" == "" ]]; then
@@ -207,15 +208,15 @@ runs:
207
208
uses : actions/cache@v4
208
209
id : cache-swift
209
210
with :
210
- path : ~ /swift-download
211
+ path : ${{ runner.temp }} /swift-download
211
212
key : " swift-${{ steps.setup.outputs.swift-version }}-${{ steps.setup.outputs.osid }}"
212
213
213
214
- name : Download Swift Host Toolchain
214
215
if : steps.cache-swift.outputs.cache-hit != 'true'
215
216
shell : bash
216
217
run : |
217
- mkdir -p ~ /swift-download
218
- cd ~ /swift-download
218
+ mkdir -p ${{ runner.temp }} /swift-download
219
+ cd ${{ runner.temp }} /swift-download
219
220
BASE_URL="https://download.swift.org/${{ steps.setup.outputs.swift-branch }}"
220
221
221
222
if [ ${RUNNER_OS} == 'Linux' ]; then
@@ -234,7 +235,7 @@ runs:
234
235
- name : Install Swift Host Toolchain
235
236
shell : bash
236
237
run : |
237
- cd ~ /swift-download
238
+ cd ${{ runner.temp }} /swift-download
238
239
if [ ${RUNNER_OS} == 'Linux' ]; then
239
240
mkdir -p ${HOME}/swift/toolchains/${{ steps.setup.outputs.swift-id }}
240
241
tar -xzf swift.tar.gz -C ${HOME}/swift/toolchains/${{ steps.setup.outputs.swift-id }} --strip 1
0 commit comments