From 7a368b26069ee2100fab1f45f14e1edb058a7b9f Mon Sep 17 00:00:00 2001 From: progre Date: Thu, 1 Aug 2024 20:41:33 +0900 Subject: [PATCH] ci: add zip --- .github/workflows/ci.yml | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ebf93e5..87812b0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,8 @@ name: Build on: push: - tags: ["v*.*.*"] + branches: [main] + tags: ['v*.*.*'] jobs: publish-tauri: @@ -12,14 +13,14 @@ jobs: fail-fast: false matrix: include: - - platform: "macos-latest" - args: "--target aarch64-apple-darwin" - - platform: "macos-latest" - args: "--target x86_64-apple-darwin" - - platform: "ubuntu-22.04" - args: "" - - platform: "windows-latest" - args: "" + - platform: 'macos-latest' + args: '--target aarch64-apple-darwin' + - platform: 'macos-latest' + args: '--target x86_64-apple-darwin' + - platform: 'ubuntu-22.04' + args: '' + - platform: 'windows-latest' + args: '' runs-on: ${{ matrix.platform }} steps: @@ -44,6 +45,12 @@ jobs: - name: install frontend dependencies run: npm install + - name: test + shell: bash + run: | + cd src-tauri/ + cargo test + - if: startsWith(github.ref, 'refs/tags/') uses: tauri-apps/tauri-action@v0 env: @@ -55,3 +62,16 @@ jobs: releaseDraft: true prerelease: false args: ${{ matrix.args }} + + - name: zip + if: startsWith(github.ref, 'refs/tags/') && matrix.platform == 'windows-latest' + shell: bash + run: | + cd src-tauri/target/release/ + zip ${{ github.ref_name }}_x64-windows.zip lmocodec.exe lmorandomizer.exe res/ + - name: release zip + if: startsWith(github.ref, 'refs/tags/') && matrix.platform == 'windows-latest' + uses: softprops/action-gh-release@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + files: ${{ github.ref_name }}_x64-windows.zip