From d21ef166d7ddb7b789220059eb3a329e26085594 Mon Sep 17 00:00:00 2001 From: honhimW Date: Sat, 14 Sep 2024 14:14:37 +0800 Subject: [PATCH] Update release.yml --- .github/workflows/release.yml | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 881e152..9460b82 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,6 +50,18 @@ jobs: uses: actions/checkout@v4 - name: Build run: cargo build --release --verbose + - name: Package (Linux) + if: matrix.os == 'ubuntu-latest' + run: tar -czvf ./target/release/ratisui-linux-amd64.tar.gz LICENSE README.md -C ./target/release ratisui + + - name: Package (Mac) + if: matrix.os == 'macos-latest' + run: tar -czvf ./target/release/ratisui-mac.tar.gz LICENSE README.md -C ./target/release ratisui + + - name: Package (Windows) + if: matrix.os == 'windows-latest' + run: Compress-Archive -Path '.\README.md', '.\LICENSE', '.\target\release\ratisui.exe' -DestinationPath '.\target\release\ratisui-windows-amd64.zip' + - name: Upload Release Asset (Linux) if: matrix.os == 'ubuntu-latest' uses: actions/upload-release-asset@v1 @@ -57,8 +69,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.create_release.outputs.upload_url }} - asset_path: ./target/release/ratisui - asset_name: ratisui-linux + asset_path: ./target/release/ratisui-linux-amd64.tar.gz + asset_name: ratisui-linux-amd64.tar.gz asset_content_type: application/octet-stream - name: Upload Release Asset (Mac) if: matrix.os == 'macos-latest' @@ -67,9 +79,10 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.create_release.outputs.upload_url }} - asset_path: ./target/release/ratisui - asset_name: ratisui-mac + asset_path: ./target/release/ratisui-mac.tar.gz + asset_name: ratisui-mac.tar.gz asset_content_type: application/octet-stream + - name: Upload Release Asset (Windows) if: matrix.os == 'windows-latest' uses: actions/upload-release-asset@v1 @@ -77,6 +90,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.create_release.outputs.upload_url }} - asset_path: .\target\release\ratisui.exe - asset_name: ratisui.exe + asset_path: .\target\release\ratisui-windows-amd64.zip + asset_name: ratisui-windows-amd64.zip asset_content_type: application/octet-stream