Skip to content

Commit 271ff18

Browse files
committed
Fix asset uploading
`gh release upload` allows to set the display label, but, as it turns out, that does not change the names of the assets in the release, and the names are required to be unique. In our case, the names of the Linux and MacOS binaries clash, and the slower of them will fail to upload.
1 parent 4ee137b commit 271ff18

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

.github/workflows/release.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,13 @@ jobs:
7272
7373
pushd target/release
7474
if [ "$RUNNER_OS" == "Windows" ]; then
75-
7z a xsnippet-api.exe.7z xsnippet-api.exe
76-
gh release upload "$RELEASE_TAG" "xsnippet-api.exe.7z#xsnippet-api-${target_arch}-${target_os}.exe.7z"
75+
export ASSET_NAME="xsnippet-api-${target_arch}-${target_os}.exe.7z"
76+
7z a $ASSET_NAME xsnippet-api.exe
7777
else
78-
tar cvzf xsnippet-api.gz xsnippet-api
79-
gh release upload "$RELEASE_TAG" "xsnippet-api.gz#xsnippet-api-${target_arch}-${target_os}.gz"
78+
export ASSET_NAME="xsnippet-api-${target_arch}-${target_os}.gz"
79+
tar cvzf $ASSET_NAME xsnippet-api
8080
fi
81+
gh release upload $RELEASE_TAG $ASSET_NAME
8182
popd
8283
env:
8384
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)