Skip to content

Commit b8893c8

Browse files
committed
Use xpath instead of xmllint to parse current Swift version
1 parent 33c9d04 commit b8893c8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

action.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,14 @@ runs:
147147
# fetch the Atom feed for the latest releases
148148
curl -fsSL --retry 8 --retry-connrefused https://github.com/skiptools/swift-android-toolchain/releases.atom --output ${{ runner.temp }}/swift-releases.xml
149149
SWIFT_VERSIONS_FILE=${{ runner.temp }}/swift-versions.txt
150+
150151
#yq -oy '.feed.entry[].title' ${{ runner.temp }}/swift-releases.xml | sort -rn > ${SWIFT_VERSIONS_FILE}
151-
xmllint --xpath "/*[local-name()='feed']/*[local-name()='entry']/*[local-name()='title']/text()" ${{ runner.temp }}/swift-releases.xml | sort -rn > ${SWIFT_VERSIONS_FILE}
152+
#xmllint --xpath "/*[local-name()='feed']/*[local-name()='entry']/*[local-name()='title']/text()" ${{ runner.temp }}/swift-releases.xml | sort -rn > ${SWIFT_VERSIONS_FILE}
153+
xpath -q -e '/feed/entry/title/text()' ${{ runner.temp }}/swift-releases.xml | sort -rn > ${SWIFT_VERSIONS_FILE}
154+
155+
# yq or xmllint are best for this, but they aren't installed by
156+
# default on GH Linux runners, we we just use grep
157+
#grep '<title>' swift-releases.xml | cut -f 2 -d '>' | cut -f 1 -d '<' | grep '^[0-9]' ${{ runner.temp }}/swift-releases.xml | sort -rn > ${SWIFT_VERSIONS_FILE}
152158
153159
# if we hardcode the latest builds, we would need to update them every time a new snapshot is released
154160

0 commit comments

Comments
 (0)