Release #17
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| env: | |
| TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} | |
| TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} | |
| # The GITHUB_TOKEN defaults to read-only, so creating the release + uploading the | |
| # build assets is denied ("Resource not accessible by integration"). Grant write. | |
| permissions: | |
| contents: write | |
| jobs: | |
| create-release: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| release_id: ${{ steps.create-release.outputs.result }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Create release | |
| id: create-release | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const { data } = await github.rest.repos.createRelease({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| tag_name: `${{ github.ref_name }}`, | |
| name: `Earth Reclaim ${{ github.ref_name }}`, | |
| body: 'See CHANGELOG.md for details.', | |
| draft: true, | |
| prerelease: false | |
| }) | |
| return data.id | |
| build-tauri: | |
| needs: create-release | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| settings: | |
| # Linux-only: the app's browser + media stack is WebKitGTK + X11, so | |
| # macOS/Windows builds compile but are non-functional. See README. | |
| - platform: 'ubuntu-22.04' | |
| args: '' | |
| runs-on: ${{ matrix.settings.platform }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.settings.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }} | |
| # Cache compiled Rust deps so cold ~20-min builds drop to a few minutes on | |
| # subsequent runs. Keyed on Cargo.lock + toolchain + platform; first run | |
| # after this is added is still cold (it populates the cache). | |
| - name: Cache Rust build | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: '. -> target' | |
| key: ${{ matrix.settings.platform }} | |
| - name: Install dependencies (Ubuntu only) | |
| if: matrix.settings.platform == 'ubuntu-22.04' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libwebkit2gtk-4.1-dev libgtk-3-dev \ | |
| libwebkit2gtk-4.0-dev \ | |
| libayatana-appindicator3-dev librsvg2-dev patchelf \ | |
| build-essential curl wget file libxdo-dev libssl-dev \ | |
| libunwind-dev \ | |
| libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ | |
| gstreamer1.0-plugins-base gstreamer1.0-plugins-good \ | |
| gstreamer1.0-plugins-bad gstreamer1.0-libav | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v3 | |
| with: | |
| version: 8 | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Build Tauri app | |
| uses: tauri-apps/tauri-action@v0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} | |
| TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} | |
| with: | |
| releaseId: ${{ needs.create-release.outputs.release_id }} | |
| args: ${{ matrix.settings.args }} | |
| publish-release: | |
| needs: [create-release, build-tauri] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Publish release | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| github.rest.repos.updateRelease({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| release_id: ${{ needs.create-release.outputs.release_id }}, | |
| draft: false | |
| }) |