|
1 | | -name: Release Workflow |
| 1 | +name: Publish |
2 | 2 |
|
3 | 3 | on: |
| 4 | + workflow_dispatch: |
4 | 5 | push: |
5 | | - paths-ignore: |
6 | | - - .github/workflows/release.yml |
7 | | - - .github/ISSUE_TEMPLATE/** |
8 | | - - README.md |
9 | | - - LICENSE |
10 | 6 | branches: |
11 | 7 | - release |
12 | | - release: |
13 | | - types: [created] |
14 | 8 |
|
15 | 9 | jobs: |
16 | | - build: |
| 10 | + publish-tauri: |
| 11 | + permissions: |
| 12 | + contents: write |
17 | 13 | strategy: |
| 14 | + fail-fast: false, |
18 | 15 | matrix: |
19 | | - platform: [ubuntu-latest, windows-latest, macos-latest] |
20 | | - runs-on: ${{ matrix.platform }} |
| 16 | + include: |
| 17 | + - platform: "macos-latest" |
| 18 | + args: "--target aarch64-apple-darwin" |
| 19 | + - platform: "macos-latest" |
| 20 | + args: "--target x86_64-apple-darwin" |
| 21 | + - platform: "ubuntu-22.04" |
| 22 | + args: "" |
| 23 | + - platform: "windows-latest" |
| 24 | + args: "" |
21 | 25 |
|
| 26 | + runs-on: ${{ matrix.platform }} |
22 | 27 | steps: |
23 | | - - name: Checkout Repo |
24 | | - uses: actions/checkout@v3 |
25 | | - |
26 | | - - name: Install Rust |
27 | | - uses: dtolnay/rust-toolchain@stable |
28 | | - |
29 | | - - name: Install Dependencies (Linux) |
30 | | - if: runner.os == 'Linux' |
31 | | - run: | |
32 | | - sudo apt update |
33 | | - sudo apt install -y libwebkit2gtk-4.0-dev libgtk-3-dev |
34 | | -
|
35 | | - - name: Install Dependencies (Windows) |
36 | | - if: runner.os == 'Windows' |
37 | | - run: | |
38 | | - choco install nsis |
39 | | -
|
40 | | - - name: Install Tauri CLI |
41 | | - run: cargo install tauri-cli |
| 28 | + - uses: actions/checkout@v4 |
42 | 29 |
|
43 | | - - name: Build Tauri App |
44 | | - run: cargo tauri build |
45 | | - |
46 | | - - name: Upload Artifacts |
47 | | - uses: actions/upload-artifact@v3 |
| 30 | + - name: setup node |
| 31 | + uses: actions/setup-node@v4 |
48 | 32 | with: |
49 | | - name: tauri-build-${{ runner.os }} |
50 | | - path: src-tauri/target/release/bundle/ |
| 33 | + node-version: lts/* |
51 | 34 |
|
52 | | - release: |
53 | | - needs: build |
54 | | - runs-on: ubuntu-latest |
55 | | - steps: |
56 | | - - name: Download Linux Build |
57 | | - uses: actions/download-artifact@v3 |
| 35 | + - name: install Rust stable |
| 36 | + uses: dtolnay/rust-toolchain@stable |
58 | 37 | with: |
59 | | - name: tauri-build-Linux |
60 | | - path: build/linux/ |
| 38 | + # Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds. |
| 39 | + targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }} |
61 | 40 |
|
62 | | - - name: Download Windows Build |
63 | | - uses: actions/download-artifact@v3 |
64 | | - with: |
65 | | - name: tauri-build-Windows |
66 | | - path: build/windows/ |
| 41 | + - name: install dependencies (ubuntu only) |
| 42 | + if: matrix.platform == 'ubuntu-22.04' |
| 43 | + run: | |
| 44 | + sudo apt-get update |
| 45 | + sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf |
67 | 46 |
|
68 | | - - name: Download macOS Build |
69 | | - uses: actions/download-artifact@v3 |
70 | | - with: |
71 | | - name: tauri-build-macOS |
72 | | - path: build/macos/ |
| 47 | + - name: install frontend dependencies |
| 48 | + run: npm install |
73 | 49 |
|
74 | | - - name: Create GitHub Release |
75 | | - uses: softprops/action-gh-release@v1 |
76 | | - with: |
77 | | - files: | |
78 | | - build/linux/** |
79 | | - build/windows/** |
80 | | - build/macos/** |
| 50 | + - uses: tauri-apps/tauri-action@v0 |
81 | 51 | env: |
82 | 52 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 53 | + with: |
| 54 | + tagName: app-v__VERSION__ |
| 55 | + releaseName: "App v__VERSION__" |
| 56 | + releaseBody: "See the assets to download this version and install." |
| 57 | + releaseDraft: true |
| 58 | + prerelease: false |
| 59 | + args: ${{ matrix.args }} |
0 commit comments