name: 'publish' on: push: branches: - production workflow_dispatch: {} jobs: publish-tauri: permissions: contents: write strategy: fail-fast: false matrix: # platform: [ubuntu-latest,macos-latest,windows-latest] settings: - platform: 'macos-latest' # for Arm based macs (M1 and above). args: '--target aarch64-apple-darwin' - platform: 'macos-latest' # for Intel based macs. args: '--target x86_64-apple-darwin' - platform: 'ubuntu-latest' # for Tauri v1 you could replace this with ubuntu-20.04. args: '--target x86_64-unknown-linux-gnu' - platform: 'windows-latest' args: '--target x86_64-pc-windows-msvc' runs-on: ${{ matrix.settings.platform }} steps: - uses: actions/checkout@v4 - name: setup node uses: actions/setup-node@v4 with: node-version: 22 - id: set_var_win if: matrix.settings.platform == 'windows-latest' run: | choco install jq -y - id: set_var shell: bash run: | echo "VERSION_JSON=$(jq -c . < version.json)" >> $GITHUB_ENV - name: install pnpm uses: pnpm/action-setup@v3 with: version: latest - name: install dependencies (ubuntu only) if: matrix.settings.platform == 'ubuntu-latest' run: | sudo apt-get update sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf - name: install Rust stable uses: dtolnay/rust-toolchain@stable # Set this to dtolnay/rust-toolchain@nightly with: # Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds. targets: ${{ matrix.settings.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }} - name: Get pnpm store directory id: pnpm-cache shell: bash run: | echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT - uses: actions/cache@v4 name: Setup pnpm cache with: path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-pnpm-store- - name: install frontend dependencies run: pnpm install --no-frozen-lockfile # change this to npm or pnpm depending on which one you use - if: matrix.settings.platform == 'macos-latest' run: rustup target add x86_64-apple-darwin - if: matrix.settings.platform == 'macos-latest' run: rustup target add aarch64-apple-darwin - uses: tauri-apps/tauri-action@v0.5.16 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} with: tagName: 'v__VERSION__' # the action automatically replaces \_\_VERSION\_\_ with the app version. releaseName: 'v__VERSION__' releaseBody: 'Release of v__VERSION__' releaseDraft: true prerelease: false args: ${{ matrix.settings.args }} tauriScript: "pnpm tauri"