diff --git a/.github/workflows/release-desktop.yml b/.github/workflows/release-desktop.yml new file mode 100644 index 0000000..3de1f4d --- /dev/null +++ b/.github/workflows/release-desktop.yml @@ -0,0 +1,75 @@ +name: Release Desktop App + +on: + release: + types: [created] + workflow_dispatch: + inputs: + release_tag: + description: "Existing release tag to attach artifacts to" + required: true + +jobs: + build: + strategy: + fail-fast: false + matrix: + include: + - platform: macos-latest + args: "--target aarch64-apple-darwin" + - platform: macos-latest + args: "--target x86_64-apple-darwin" + - platform: ubuntu-22.04 + args: "" + - platform: windows-latest + args: "" + + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@v4 + + - name: Install Linux dependencies + if: matrix.platform == 'ubuntu-22.04' + run: | + sudo apt-get update + sudo apt-get install -y \ + libwebkit2gtk-4.1-dev \ + libappindicator3-dev \ + librsvg2-dev \ + patchelf \ + libssl-dev \ + build-essential \ + curl \ + wget \ + file \ + libayatana-appindicator3-dev + + - name: Install Rust stable + uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }} + + - name: Rust cache + uses: swatinem/rust-cache@v2 + with: + workspaces: "./ -> target" + + - name: Setup Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - name: Install frontend dependencies + working-directory: crates/toolpath-desktop/frontend + run: bun install + + - name: Build and upload Tauri app + uses: tauri-apps/tauri-action@v0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + projectPath: crates/toolpath-desktop + tagName: ${{ github.event.inputs.release_tag || github.event.release.tag_name }} + releaseName: ${{ github.event.inputs.release_tag || github.event.release.tag_name }} + releaseId: ${{ github.event.release.id }} + args: ${{ matrix.args }}