From 107178aee3d1631fc9dedacc7e6b8053680abef5 Mon Sep 17 00:00:00 2001 From: Rynco Maekawa Date: Sat, 17 Oct 2020 20:56:22 +0800 Subject: [PATCH] feat: Add strip and upx to windows/mac --- .github/workflows/publish.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 46546535de1..18079b45fd6 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -26,9 +26,22 @@ jobs: - uses: dtolnay/rust-toolchain@stable - uses: actions/checkout@v1 + - name: Install UPX on Windows + if: ${{matrix.os == 'windows-latest'}} + run: choco install upx + + - name: Install UPX on MacOS + if: ${{matrix.os == 'macos-latest'}} + run: brew install upx + - name: Build run: cargo build --release --locked + - name: compress + run: | + strip -s ./target/release/${{ matrix.artifact_name }} + upx -9 --lzma ./target/release/${{ matrix.artifact_name }} + - name: Zip run: tar czvf ${{ matrix.asset_name }}.tar.gz -C ./target/release/ ${{ matrix.artifact_name }}