|
1 |
| -name: Build and Release Tauri App |
2 |
| - |
| 1 | +name: Release |
3 | 2 | on:
|
4 | 3 | push:
|
5 |
| - branches: [ "main" ] |
6 |
| - pull_request: |
7 |
| - branches: [ "main" ] |
8 |
| - |
9 |
| -env: |
10 |
| - CARGO_TERM_COLOR: always |
| 4 | + tags: |
| 5 | + - "v*" |
| 6 | + workflow_dispatch: |
11 | 7 |
|
12 | 8 | jobs:
|
13 |
| - build: |
14 |
| - runs-on: windows-latest |
| 9 | + release: |
| 10 | + permissions: |
| 11 | + contents: write |
| 12 | + strategy: |
| 13 | + fail-fast: false |
| 14 | + matrix: |
| 15 | + platform: [macos-latest, windows-latest] # Ubuntu-20.04 has been removed |
| 16 | + runs-on: ${{ matrix.platform }} |
15 | 17 |
|
16 | 18 | steps:
|
17 |
| - - name: Checkout code |
| 19 | + - name: Checkout repository |
18 | 20 | uses: actions/checkout@v3
|
19 | 21 |
|
20 |
| - - name: Set up Rust |
21 |
| - uses: actions-rs/toolchain@v1 |
| 22 | + - name: Install dependencies (ubuntu only) |
| 23 | + if: matrix.platform == 'ubuntu-20.04' |
| 24 | + # You can remove libayatana-appindicator3-dev if you don't use the system tray feature. |
| 25 | + run: | |
| 26 | + sudo apt-get update |
| 27 | + sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev |
| 28 | +
|
| 29 | + - name: Rust setup |
| 30 | + uses: dtolnay/rust-toolchain@stable |
| 31 | + |
| 32 | + - name: Rust cache |
| 33 | + uses: swatinem/rust-cache@v2 |
22 | 34 | with:
|
23 |
| - toolchain: stable |
24 |
| - override: true |
| 35 | + workspaces: "./src-tauri -> target" |
25 | 36 |
|
26 |
| - - name: Install Tauri CLI |
27 |
| - run: cargo install tauri-cli |
| 37 | + - name: Sync node version and setup cache |
| 38 | + uses: actions/setup-node@v3 |
| 39 | + with: |
| 40 | + node-version: "lts/*" |
| 41 | + cache: "npm" # Set this to npm, yarn or pnpm. |
28 | 42 |
|
29 |
| - - name: Build Tauri App |
30 |
| - run: cargo tauri build |
| 43 | + - name: Install frontend dependencies |
| 44 | + # If you don't have `beforeBuildCommand` configured you may want to build your frontend here too. |
| 45 | + run: npm install # Change this to npm, yarn or pnpm. |
31 | 46 |
|
32 |
| - - name: Sign Tauri App |
33 |
| - env: |
34 |
| - TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} |
35 |
| - run: tauri signer sign -p <(echo "$TAURI_PRIVATE_KEY") -f src-tauri/target/release/bundle/msi/*.msi |
| 47 | + - name: Build the app |
| 48 | + uses: tauri-apps/tauri-action@v0 |
36 | 49 |
|
37 |
| - - name: Create Release |
38 |
| - id: create_release |
39 |
| - uses: actions/create-release@v1 |
40 | 50 | env:
|
41 | 51 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
42 | 52 | with:
|
43 |
| - tag_name: ${{ github.sha }} |
44 |
| - release_name: Release ${{ github.sha }} |
45 |
| - draft: false |
| 53 | + tagName: ${{ github.ref_name }} # This only works if your workflow triggers on new tags. |
| 54 | + releaseName: "App Name v__VERSION__" # tauri-action replaces \_\_VERSION\_\_ with the app version. |
| 55 | + releaseBody: "See the assets to download and install this version." |
| 56 | + releaseDraft: true |
46 | 57 | prerelease: false
|
47 |
| - |
48 |
| - - name: Upload Release Assets |
49 |
| - uses: actions/upload-release-asset@v1 |
50 |
| - with: |
51 |
| - upload_url: ${{ steps.create_release.outputs.upload_url }} |
52 |
| - asset_path: | |
53 |
| - src-tauri/target/release/bundle/msi/*.msi |
54 |
| - src-tauri/target/release/bundle/msi/*.sig |
55 |
| - asset_name: | |
56 |
| - $(basename src-tauri/target/release/bundle/msi/*.msi) |
57 |
| - $(basename src-tauri/target/release/bundle/msi/*.sig) |
58 |
| - asset_content_type: application/octet-stream |
0 commit comments