Release #27
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: | |
| workflow_dispatch: | |
| inputs: | |
| branch: | |
| description: 'Branch to release from' | |
| required: false | |
| default: 'main' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test-build: | |
| name: Test Build | |
| permissions: | |
| contents: read | |
| uses: ./.github/workflows/build.yml | |
| with: | |
| branch: ${{ inputs.branch }} | |
| format: | |
| name: Code Formatting | |
| needs: test-build | |
| permissions: | |
| contents: write | |
| uses: ./.github/workflows/format.yml | |
| semantic-release: | |
| name: Semantic Release | |
| needs: format | |
| runs-on: ubuntu-latest | |
| outputs: | |
| release_tag: ${{ steps.set_outputs.outputs.release_tag }} | |
| release_body: ${{ steps.set_outputs.outputs.release_body }} | |
| release_draft: ${{ steps.set_outputs.outputs.release_draft }} | |
| release_prerelease: ${{ steps.set_outputs.outputs.release_prerelease }} | |
| release_released: ${{ steps.set_outputs.outputs.release_released }} | |
| permissions: | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| id-token: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ github.event.inputs.branch || 'main' }} | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.16.1 | |
| - name: Setup Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: lts/* | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Release | |
| id: release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: pnpm exec semantic-release --no-ci || true | |
| - name: Set release outputs | |
| id: set_outputs | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| LATEST_TAG=$(gh release list --limit 1 --json tagName -q '.[0].tagName') | |
| if [ -n "$LATEST_TAG" ]; then | |
| RELEASE_INFO=$(gh release view "$LATEST_TAG" --json tagName,name,body,isDraft,isPrerelease) | |
| TAG=$(echo "$RELEASE_INFO" | jq -r '.tagName') | |
| NAME=$(echo "$RELEASE_INFO" | jq -r '.name') | |
| BODY=$(echo "$RELEASE_INFO" | jq -r '.body') | |
| DRAFT=$(echo "$RELEASE_INFO" | jq -r '.isDraft') | |
| PRERELEASE=$(echo "$RELEASE_INFO" | jq -r '.isPrerelease') | |
| echo "release_tag=$TAG" >> $GITHUB_OUTPUT | |
| echo "release_body<<EOF" >> $GITHUB_OUTPUT | |
| echo "$BODY" >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| echo "release_draft=$DRAFT" >> $GITHUB_OUTPUT | |
| echo "release_prerelease=$PRERELEASE" >> $GITHUB_OUTPUT | |
| echo "release_released=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "release_tag=" >> $GITHUB_OUTPUT | |
| echo "release_body=" >> $GITHUB_OUTPUT | |
| echo "release_draft=false" >> $GITHUB_OUTPUT | |
| echo "release_prerelease=false" >> $GITHUB_OUTPUT | |
| echo "release_released=false" >> $GITHUB_OUTPUT | |
| fi | |
| tauri-release: | |
| name: Tauri Release | |
| needs: semantic-release | |
| if: needs.semantic-release.outputs.release_released == 'true' | |
| permissions: | |
| contents: write | |
| 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: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ github.event.inputs.branch || 'main' }} | |
| - name: install dependencies (ubuntu only) | |
| if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above. | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.16.1 | |
| - name: Setup Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: lts/* | |
| cache: 'pnpm' | |
| - name: Cache Rust crates | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| key: ${{ runner.os }}-cargo | |
| restore-keys: | | |
| ${{ runner.os }}-cargo | |
| - name: Install Rust + Targets | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }} | |
| - name: Install frontend deps | |
| run: pnpm install --frozen-lockfile | |
| - name: Build & Publish Tauri | |
| uses: tauri-apps/tauri-action@v0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} | |
| TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} | |
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
| with: | |
| tagName: ${{ needs.semantic-release.outputs.release_tag }} | |
| releaseName: ${{ needs.semantic-release.outputs.release_tag }} | |
| releaseBody: ${{ needs.semantic-release.outputs.release_body }} | |
| releaseDraft: ${{ needs.semantic-release.outputs.release_draft == 'true' }} | |
| prerelease: ${{ needs.semantic-release.outputs.release_prerelease == 'true' }} | |
| args: ${{ matrix.args }} | |
| - name: Cache Tauri target folder | |
| uses: actions/cache@v5 | |
| with: | |
| path: src-tauri/target | |
| key: ${{ runner.os }}-tauri-target | |
| restore-keys: | | |
| ${{ runner.os }}-tauri-target |