Skip to content

ci(desktop): release from git tag instead of source-tree bump - #144

Open
chareice wants to merge 1 commit into
mainfrom
desktop-release-from-tag
Open

ci(desktop): release from git tag instead of source-tree bump#144
chareice wants to merge 1 commit into
mainfrom
desktop-release-from-tag

Conversation

@chareice

Copy link
Copy Markdown
Collaborator

Summary

Removes the bump-commit-per-release ritual from desktop releases.

  • CI parses the version out of the pushed tag (desktop-v0.3.00.3.0) and patches tauri.conf.json on each runner before tauri-action runs.
  • Matrix uploads land in a draft release; a separate publish job flips it to published once all three platforms succeed. If any platform fails, the release stays a draft.
  • tauri.conf.json version set to 0.0.0 as a placeholder (overridden at build time). Local tauri dev will show 0.0.0 — intentional.
  • Runbook updated with the new release flow.

How to release after this lands

git tag desktop-v<VERSION> && git push origin desktop-v<VERSION>

That's it. No more bump PR.

🤖 Generated with Claude Code

Parse the version from the pushed tag name in CI, patch
tauri.conf.json on the runner, and let the build proceed. Removes
the need for a bump commit + PR per release.

The matrix builds upload to a draft release (so end-users never see a
partial release while platforms are still uploading). A follow-up
publish job flips the draft to published once all three platforms
succeed. If any matrix platform fails, the release stays as a draft.

Set tauri.conf.json version to 0.0.0 as a placeholder — overridden at
build time. Documented the new flow in docs/deployment/runbook.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 20, 2026 05:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the desktop release pipeline to derive the app version from pushed git tags and publish the GitHub release only after all platform builds succeed, removing the need for source-tree version bump commits.

Changes:

  • Set tauri.conf.json to a placeholder version (0.0.0) and inject the real version during CI from desktop-v* tags.
  • Update the desktop GitHub Actions workflow to create a draft release during matrix builds and publish it in a follow-up job.
  • Document the new desktop release flow in the deployment runbook.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/desktop/src-tauri/tauri.conf.json Uses placeholder version intended to be overridden by CI.
docs/deployment/runbook.md Adds runbook steps for releasing the desktop app via desktop-v<VERSION> tags.
.github/workflows/desktop.yml Parses version from tag, patches tauri.conf.json on runners, builds in a matrix, then publishes the release after success.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +55 to +63
- name: Inject version from tag
shell: bash
run: |
REF="${GITHUB_REF_NAME}"
VERSION="${REF#desktop-v}"
if [ -z "$VERSION" ] || [ "$VERSION" = "$REF" ]; then
echo "::error::Expected tag like desktop-vX.Y.Z, got '$REF'"
exit 1
fi

Copilot AI Apr 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this workflow is also enabled for workflow_dispatch, GITHUB_REF_NAME will typically be a branch name (e.g. main) and this step will always fail the run. Either remove workflow_dispatch if it's not intended, or add a dispatch input for the version (and/or gate this step to only run on tag pushes).

Copilot uses AI. Check for mistakes.
if [ -z "$VERSION" ] || [ "$VERSION" = "$REF" ]; then
echo "::error::Expected tag like desktop-vX.Y.Z, got '$REF'"
exit 1
fi

Copilot AI Apr 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message says it expects a tag like desktop-vX.Y.Z, but the current parsing only checks the prefix and will accept any suffix (including non-semver), which then gets written into tauri.conf.json and may fail later with a less clear error. Consider validating the extracted version against a semver-like pattern here (or loosen the message to match the actual validation).

Suggested change
fi
fi
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$ ]]; then
echo "::error::Expected tag like desktop-vX.Y.Z, got '$REF'"
exit 1
fi

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants