|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + push: |
| 6 | + tags: |
| 7 | + - 'v*' |
| 8 | + # branches: |
| 9 | + # - 'main' |
| 10 | + |
| 11 | +jobs: |
| 12 | + publish-tauri: |
| 13 | + permissions: |
| 14 | + contents: write |
| 15 | + strategy: |
| 16 | + fail-fast: false |
| 17 | + matrix: |
| 18 | + include: |
| 19 | + - platform: 'macos-latest' # for Arm based macs (M1 and above). |
| 20 | + target: 'aarch64-apple-darwin' |
| 21 | + args: '--target aarch64-apple-darwin' |
| 22 | + - platform: 'macos-latest' # for Intel based macs. |
| 23 | + target: 'x86_64-apple-darwin' |
| 24 | + args: '--target x86_64-apple-darwin' |
| 25 | + |
| 26 | + - platform: 'ubuntu-22.04' |
| 27 | + target: 'x86_64-unknown-linux-gnu' |
| 28 | + args: '' |
| 29 | + - platform: 'ubuntu-22.04' |
| 30 | + target: 'aarch64-unknown-linux-gnu' |
| 31 | + args: '' |
| 32 | + |
| 33 | + - platform: 'windows-latest' |
| 34 | + target: 'x86_64-pc-windows-msvc' |
| 35 | + args: '' |
| 36 | + - platform: 'windows-latest' |
| 37 | + target: 'aarch64-pc-windows-msvc' |
| 38 | + args: '--target aarch64-pc-windows-msvc' |
| 39 | + |
| 40 | + runs-on: ${{ matrix.platform }} |
| 41 | + timeout-minutes: 60 |
| 42 | + steps: |
| 43 | + - uses: actions/checkout@v4 |
| 44 | + |
| 45 | + - name: Check Tauri |
| 46 | + if: env.TAURI_PRIVATE_KEY == '' |
| 47 | + run: | |
| 48 | + echo "::error::TAURI_PRIVATE_KEY is required but not set!" |
| 49 | + exit 1 |
| 50 | +
|
| 51 | + - name: Install rust target |
| 52 | + run: rustup target add ${{ matrix.target }} |
| 53 | + |
| 54 | + - uses: pnpm/action-setup@v3 |
| 55 | + with: |
| 56 | + version: latest |
| 57 | + |
| 58 | + - name: Sync node version and setup cache |
| 59 | + uses: actions/setup-node@v4 |
| 60 | + with: |
| 61 | + node-version: 20 |
| 62 | + cache: pnpm |
| 63 | + |
| 64 | + - name: Install frontend dependencies |
| 65 | + run: pnpm install # change this to npm, pnpm or bun depending on which one you use. |
| 66 | + |
| 67 | + - name: install Rust stable |
| 68 | + uses: dtolnay/rust-toolchain@stable |
| 69 | + with: |
| 70 | + targets: ${{ matrix.target }} |
| 71 | + |
| 72 | + - name: Regenerate Icons |
| 73 | + run: pnpm tauri icon |
| 74 | + |
| 75 | + - name: Create Apple icon |
| 76 | + if: matrix.platform == 'macos-latest' |
| 77 | + run: node ./scripts/creatIcon.cjs |
| 78 | + |
| 79 | + - name: install dependencies (ubuntu only) |
| 80 | + if: matrix.platform == 'ubuntu-22.04' |
| 81 | + run: | |
| 82 | + sudo apt-get update |
| 83 | + sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf |
| 84 | +
|
| 85 | + - uses: Sjj1024/tauri-zhaction@tauri-zhaciton |
| 86 | + env: |
| 87 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 88 | + with: |
| 89 | + tagName: 'PakePlus' |
| 90 | + releaseName: 'PakePlus v__VERSION__' |
| 91 | + releaseBody: 'This is a workflow to help you automate the publishing of your PakePlus project to GitHub Packages.' |
| 92 | + releaseDraft: false |
| 93 | + prerelease: false |
| 94 | + publish: true |
| 95 | + args: ${{ matrix.args }} |
| 96 | + renameArtifacts: 'PakePlus' |
0 commit comments