Skip to content

Commit 8afbb22

Browse files
authored
Merge pull request #133 from xsnippet/compressed-builds
Compress release assets before uploading them to Github
2 parents 6294e03 + 4d57115 commit 8afbb22

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,20 @@ jobs:
7474
args: --release
7575

7676
- run: |
77+
rustc --print cfg | grep = > rustc.vars
78+
source rustc.vars
79+
80+
pushd target/release
7781
if [ "$RUNNER_OS" == "Windows" ]; then
78-
echo "ASSET_NAME=xsnippet-api-${{ matrix.os }}.exe" >> $GITHUB_ENV
79-
echo "ASSET_PATH=./target/release/xsnippet-api.exe" >> $GITHUB_ENV
82+
echo "ASSET_NAME=xsnippet-api-${target_arch}-${target_os}.exe.7z" >> $GITHUB_ENV
83+
echo "ASSET_PATH=./target/release/xsnippet-api.exe.7z" >> $GITHUB_ENV
84+
7z a xsnippet-api.exe.7z xsnippet-api.exe
8085
else
81-
echo "ASSET_NAME=xsnippet-api-${{ matrix.os }}" >> $GITHUB_ENV
82-
echo "ASSET_PATH=./target/release/xsnippet-api" >> $GITHUB_ENV
86+
echo "ASSET_NAME=xsnippet-api-${target_arch}-${target_os}.gz" >> $GITHUB_ENV
87+
echo "ASSET_PATH=./target/release/xsnippet-api.gz" >> $GITHUB_ENV
88+
tar cvzf xsnippet-api.gz xsnippet-api
8389
fi
90+
popd
8491
8592
- uses: actions/upload-release-asset@v1
8693
env:

0 commit comments

Comments
 (0)