From 6a865424662f1183ae38f857094595202e33466d Mon Sep 17 00:00:00 2001 From: Guyutongxue Date: Sat, 7 May 2022 11:09:01 +0800 Subject: [PATCH] update release workflow --- .github/workflows/tauri.yml | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/.github/workflows/tauri.yml b/.github/workflows/tauri.yml index 77fd13d..3524f08 100644 --- a/.github/workflows/tauri.yml +++ b/.github/workflows/tauri.yml @@ -1,13 +1,12 @@ name: "Tauri" on: push: - branches: [ main ] - tags: [ "*" ] + branches: [main] + tags: ["*"] pull_request: - branches: [ main ] + branches: [main] env: - TAURI_SCRIPT: pnpm tauri GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} jobs: @@ -18,20 +17,23 @@ jobs: os: [windows-latest, ubuntu-latest, macos-latest] include: - os: windows-latest - bundle: "vscch.exe" + bundle: "msi/vscch*.msi" + exe: "vscch.exe" - os: ubuntu-latest - bundle: "bundle/appimage/vscch*.AppImage" + bundle: "appimage/vscch*.AppImage" + exe: "vscch" - os: macos-latest - bundle: "bundle/dmg/vscch*.dmg" + bundle: "dmg/vscch*.dmg" + exe: "vscch" runs-on: ${{ matrix.os }} - # https://github.com/tauri-apps/tauri-action#testing-the-build + steps: - uses: actions/checkout@v2 - name: Install Node.js uses: actions/setup-node@v2 with: - node-version: '16' + node-version: "16" - name: Install Rust uses: actions-rs/toolchain@v1 with: @@ -47,9 +49,16 @@ jobs: pnpm install - name: Tauri build run: pnpm tauri build + - name: Pack executable + if: ${{ github.ref_type == 'tag' }} + run: | + cd ${{ github.workspace }} + 7z a src-tauri/target/vscch_${{ github.ref_name }}_${{ runner.os }}.7z src-tauri/target/release/${{ matrix.exe }} ${{ github.workspace }}/LICENSE - name: Release - if: ${{ startsWith(github.ref, 'refs/tags/') }} + if: ${{ github.ref_type == 'tag' }} uses: softprops/action-gh-release@v1 with: - files: ${{ github.workspace }}/src-tauri/target/release/${{ matrix.bundle }} + files: | + ${{ github.workspace }}/src-tauri/target/release/bundle/${{ matrix.bundle }} + ${{ github.workspace }}/src-tauri/target/vscch*.7z draft: true