Skip to content

Commit 087a34d

Browse files
committed
Fix support for matching nightly-6.1 to 6.1-SNAPSHOT
1 parent 773da98 commit 087a34d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

action.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,9 @@ runs:
103103
. /etc/os-release
104104
echo "osidpair=${ID}${VERSION_ID}" >> $GITHUB_OUTPUT
105105
echo "osid=${ID}$(echo ${VERSION_ID} | tr -d '.')" >> $GITHUB_OUTPUT
106-
# patchelf is needed to check whether an ELF binary contains the Testing library
107-
which patchelf || apt install patchelf
108106
elif [ ${RUNNER_OS} == 'macOS' ]; then
109107
echo "osidpair=macos" >> $GITHUB_OUTPUT
110108
echo "osid=macos" >> $GITHUB_OUTPUT
111-
which patchelf || brew install patchelf
112109
else
113110
echo "::error::Unsupported platform: ${RUNNER_OS}"
114111
exit 1
@@ -156,9 +153,11 @@ runs:
156153
# use the latest snapshot release
157154
SWIFT_VERSION=$(cat ${SWIFT_VERSIONS_FILE} | grep -- '-SNAPSHOT' | head -n 1)
158155
elif [[ "${SWIFT_VERSION}" == nightly-* ]]; then
156+
echo "Checking nightly build for: ${SWIFT_VERSION}"
159157
# e.g., nightly-6.1 will match 6.1-DEVELOPMENT-SNAPSHOT-*
160158
SWIFT_VERSION=$(echo ${SWIFT_VERSION} | sed 's;nightly-;;g')
161159
SWIFT_VERSION=$(cat ${SWIFT_VERSIONS_FILE} | grep -- "${SWIFT_VERSION}-SNAPSHOT" | head -n 1)
160+
echo "Found nightly build: ${SWIFT_VERSION}"
162161
else
163162
# match "6.0" to "6.0.3"
164163
# match "6.1" to "6.1-DEVELOPMENT-SNAPSHOT-2025-03-07-a"
@@ -240,10 +239,13 @@ runs:
240239
mkdir -p ${HOME}/swift/toolchains/${{ steps.setup.outputs.swift-id }}
241240
tar -xzf swift.tar.gz -C ${HOME}/swift/toolchains/${{ steps.setup.outputs.swift-id }} --strip 1
242241
SWIFT_INSTALLATION=$HOME/swift/toolchains/${{ steps.setup.outputs.swift-id }}/usr
242+
# patchelf is needed to check whether an ELF binary contains the Testing library
243+
which patchelf 2>&1 > /dev/null || apt install patchelf
243244
elif [ ${RUNNER_OS} == 'macOS' ]; then
244245
/usr/sbin/installer -pkg swift.pkg -target CurrentUserHomeDirectory
245246
SWIFT_INSTALLATION=${HOME}/Library/Developer/Toolchains/${{ steps.setup.outputs.swift-id }}.xctoolchain/usr
246247
echo "TOOLCHAINS=$(plutil -extract CFBundleIdentifier raw ${SWIFT_INSTALLATION}/Info.plist)" >> $GITHUB_ENV
248+
which patchelf 2>&1 > /dev/null || brew install patchelf
247249
else
248250
echo "::error::Unsupported platform: ${RUNNER_OS}"
249251
exit 1

0 commit comments

Comments
 (0)