|
| 1 | +name: "tauri-build" |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + push: |
| 6 | + |
| 7 | +jobs: |
| 8 | + publish-tauri: |
| 9 | + permissions: |
| 10 | + contents: write |
| 11 | + strategy: |
| 12 | + fail-fast: false |
| 13 | + matrix: |
| 14 | + include: |
| 15 | + - platform: "macos-latest" # for Arm based macs (M1 and above). |
| 16 | + name: macos-arm |
| 17 | + args: "--target aarch64-apple-darwin" |
| 18 | + - platform: "macos-latest" # for Intel based macs. |
| 19 | + name: macos-intel |
| 20 | + args: "--target x86_64-apple-darwin" |
| 21 | + - platform: "ubuntu-22.04" |
| 22 | + name: linux |
| 23 | + args: "" |
| 24 | + - platform: "windows-latest" |
| 25 | + name: windows |
| 26 | + args: "" |
| 27 | + |
| 28 | + runs-on: ${{ matrix.platform }} |
| 29 | + steps: |
| 30 | + - uses: actions/checkout@v4 |
| 31 | + |
| 32 | + - name: install dependencies (ubuntu only) |
| 33 | + if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above. |
| 34 | + run: | |
| 35 | + sudo apt-get update |
| 36 | + sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev libudev-dev patchelf |
| 37 | +
|
| 38 | + - name: setup node |
| 39 | + uses: actions/setup-node@v4 |
| 40 | + with: |
| 41 | + node-version: lts/* |
| 42 | + cache: "npm" # Set this to npm, yarn or pnpm. |
| 43 | + |
| 44 | + - name: install Rust stable |
| 45 | + uses: dtolnay/rust-toolchain@stable # Set this to dtolnay/rust-toolchain@nightly |
| 46 | + with: |
| 47 | + # Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds. |
| 48 | + targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }} |
| 49 | + |
| 50 | + - name: Rust cache |
| 51 | + uses: swatinem/rust-cache@v2 |
| 52 | + with: |
| 53 | + workspaces: "./src-tauri -> target" |
| 54 | + |
| 55 | + - name: install frontend dependencies |
| 56 | + # If you don't have `beforeBuildCommand` configured you may want to build your frontend here too. |
| 57 | + run: npm ci |
| 58 | + |
| 59 | + - uses: tauri-apps/tauri-action@v0 |
| 60 | + name: build |
| 61 | + env: |
| 62 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 63 | + with: |
| 64 | + args: ${{ matrix.args }} |
| 65 | + |
| 66 | + - uses: actions/upload-artifact@v4 |
| 67 | + with: |
| 68 | + name: zmk-studio-${{ matrix.name }} |
| 69 | + path: | |
| 70 | + src-tauri/target/release/bundle/**/*.deb |
| 71 | + src-tauri/target/release/bundle/**/*.AppImage |
| 72 | + src-tauri/target/*/release/bundle/**/*.dmg |
| 73 | + src-tauri/target/*/release/bundle/**/*.app |
| 74 | + src-tauri/target/release/bundle/**/*.msi |
| 75 | + src-tauri/target/release/bundle/**/*.exe |
0 commit comments