fix: show real app version in About (was hardcoded 0.1.0) #23
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: Auto-publish release | |
| # When tauri.conf.json's version changes on main: | |
| # 1. Create a GitHub release with tag v<version>. | |
| # 2. Dispatch release.yml directly to build + sign + upload artifacts. | |
| # | |
| # Step 2 is required because workflows triggered by GITHUB_TOKEN (which is | |
| # how step 1 creates the release) do NOT cascade to other workflows — this | |
| # is a documented anti-recursion safeguard. workflow_dispatch is the one | |
| # event that fires even from GITHUB_TOKEN, so we use it explicitly. | |
| # | |
| # Idempotent: if a release with that tag already exists, this no-ops. | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "apps/desktop/src-tauri/tauri.conf.json" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| actions: write | |
| concurrency: | |
| group: auto-release-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Read version from tauri.conf.json | |
| id: ver | |
| run: | | |
| set -euo pipefail | |
| VERSION=$(jq -r '.version' apps/desktop/src-tauri/tauri.conf.json) | |
| if [ -z "$VERSION" ] || [ "$VERSION" = "null" ]; then | |
| echo "::error::No version field in apps/desktop/src-tauri/tauri.conf.json" | |
| exit 1 | |
| fi | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| echo "tag=v$VERSION" >> "$GITHUB_OUTPUT" | |
| - name: Check if release already exists | |
| id: check | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| set -euo pipefail | |
| if gh release view "${{ steps.ver.outputs.tag }}" \ | |
| --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then | |
| echo "exists=true" >> "$GITHUB_OUTPUT" | |
| echo "Release ${{ steps.ver.outputs.tag }} already exists — skipping." | |
| else | |
| echo "exists=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Create GitHub release | |
| if: steps.check.outputs.exists != 'true' | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| set -euo pipefail | |
| gh release create "${{ steps.ver.outputs.tag }}" \ | |
| --repo "$GITHUB_REPOSITORY" \ | |
| --target "$GITHUB_SHA" \ | |
| --title "CodeVetter ${{ steps.ver.outputs.tag }}" \ | |
| --generate-notes | |
| - name: Dispatch release build workflow | |
| if: steps.check.outputs.exists != 'true' | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| set -euo pipefail | |
| gh workflow run release.yml \ | |
| --repo "$GITHUB_REPOSITORY" \ | |
| --ref main \ | |
| -f tag="${{ steps.ver.outputs.tag }}" |