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