File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -136,6 +136,7 @@ jobs:
136136 shell : bash
137137 env :
138138 GH_TOKEN : ${{ github.token }}
139+ RELEASE_TAG : ${{ inputs.release_tag || github.ref_name }}
139140 run : |
140141 set -euo pipefail
141142 mapfile -t assets < <(
@@ -148,4 +149,4 @@ jobs:
148149 exit 1
149150 fi
150151 bash scripts/upload-release-asset.sh \
151- "${{ inputs.release_tag || github.ref_name }} " "${assets[@]}"
152+ "$RELEASE_TAG " "${assets[@]}"
Original file line number Diff line number Diff line change @@ -146,6 +146,7 @@ jobs:
146146 shell : bash
147147 env :
148148 GH_TOKEN : ${{ github.token }}
149+ RELEASE_TAG : ${{ inputs.release_tag || github.ref_name }}
149150 run : |
150151 set -euo pipefail
151152 mapfile -t assets < <(find staged -type f -name 'secretspec_ffi_*' -print | sort)
@@ -155,7 +156,7 @@ jobs:
155156 exit 1
156157 fi
157158 bash scripts/upload-release-asset.sh \
158- "${{ inputs.release_tag || github.ref_name }} " "${assets[@]}"
159+ "$RELEASE_TAG " "${assets[@]}"
159160
160161 - name : Publish the Go module tag
161162 if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
Original file line number Diff line number Diff line change @@ -136,9 +136,10 @@ jobs:
136136 shell : bash
137137 env :
138138 GH_TOKEN : ${{ github.token }}
139+ RELEASE_TAG : ${{ inputs.release_tag || github.ref_name }}
139140 run : |
140141 set -euo pipefail
141142 asset="secretspec-go-static-x86_64-linux-musl.tar.gz"
142143 tar -czf "$asset" -C staged .
143144 bash scripts/upload-release-asset.sh \
144- "${{ inputs.release_tag || github.ref_name }} " "$asset"
145+ "$RELEASE_TAG " "$asset"
Original file line number Diff line number Diff line change @@ -148,4 +148,6 @@ jobs:
148148 shell : bash
149149 env :
150150 GH_TOKEN : ${{ github.token }}
151- run : bash scripts/upload-release-asset.sh "${{ inputs.release_tag || github.ref_name }}" "${{ steps.stage.outputs.asset }}"
151+ RELEASE_ASSET : ${{ steps.stage.outputs.asset }}
152+ RELEASE_TAG : ${{ inputs.release_tag || github.ref_name }}
153+ run : bash scripts/upload-release-asset.sh "$RELEASE_TAG" "$RELEASE_ASSET"
Original file line number Diff line number Diff line change @@ -173,7 +173,8 @@ jobs:
173173 - name : Attach the XCFramework to the GitHub Release
174174 env :
175175 GH_TOKEN : ${{ github.token }}
176+ RELEASE_TAG : ${{ inputs.release_tag || github.ref_name }}
176177 run : >-
177178 bash scripts/upload-release-asset.sh
178- "${{ inputs.release_tag || github.ref_name }} "
179+ "$RELEASE_TAG "
179180 artifacts/CSecretSpec.xcframework.zip
Original file line number Diff line number Diff line change 1010# retry). Needs GH_TOKEN with contents: write.
1111set -euo pipefail
1212
13+ if (( $# < 2 )) ; then
14+ echo " usage: upload-release-asset.sh <tag> <asset> [asset...]" >&2
15+ exit 2
16+ fi
17+
1318tag=" $1 "
1419shift
1520
21+ # Release publication uses version tags. Reject malformed input before it is
22+ # passed to gh, while allowing SemVer prerelease and build suffixes.
23+ if [[ ! " $tag " =~ ^v[0-9]+\. [0-9]+\. [0-9]+ ([+-][0-9A-Za-z][0-9A-Za-z.+-]* )? $ ]]; then
24+ echo " invalid release tag: $tag " >&2
25+ exit 2
26+ fi
27+
1628files=()
1729for asset in " $@ " ; do
1830 # Record only the basename so `sha256sum -c` works after users download the
You can’t perform that action at this time.
0 commit comments