Skip to content

Automate draft release publication from main CI - #2

Merged
YuyangXueEd merged 2 commits into
mainfrom
codex/auto-release-ci
May 31, 2026
Merged

Automate draft release publication from main CI#2
YuyangXueEd merged 2 commits into
mainfrom
codex/auto-release-ci

Conversation

@YuyangXueEd

Copy link
Copy Markdown
Contributor

Summary

  • add a post-build release job for main/workflow_dispatch runs
  • derive the release tag from package.json and validate it against the Tauri version
  • create a draft GitHub release from the current workflow artifacts when the version is not already released

Notes

  • pushed the missing v0.1.1 tag separately so the existing tag workflow can generate the 0.1.1 release now
  • if a version tag/release already exists, future main runs skip release publication instead of trying to republish the same version

Validation

  • git diff --check

Copilot AI review requested due to automatic review settings May 31, 2026 23:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds an automated “draft release publication” path to the existing Desktop CI so that pushes (or manual dispatches) on main can publish a draft GitHub Release using the workflow’s build artifacts, keyed off the app version in package.json (and validated against the Tauri config version).

Changes:

  • Add a publish-release job that runs after the matrix build on main pushes / workflow_dispatch.
  • Resolve and validate the release version/tag from package.json and src-tauri/tauri.conf.json, and skip if the release already exists.
  • Create/push a version tag when missing, then create a draft GitHub Release and upload workflow artifacts as release assets.

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

Comment on lines +118 to +134
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Resolve release version
id: version
shell: bash
run: |
VERSION="$(node -p "require('./package.json').version")"
TAURI_VERSION="$(node -e "const fs=require('fs'); console.log(JSON.parse(fs.readFileSync('src-tauri/tauri.conf.json','utf8')).version)")"
if [ "$VERSION" != "$TAURI_VERSION" ]; then
echo "::error::package.json version ($VERSION) does not match src-tauri/tauri.conf.json version ($TAURI_VERSION)."
exit 1
fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "tag=v$VERSION" >> "$GITHUB_OUTPUT"
Comment thread .github/workflows/release.yml Outdated
Comment on lines +226 to +228
while IFS= read -r -d '' file; do
gh release upload "$TAG" "$file" --clobber
done < <(find release-assets -type f -print0)
Comment on lines +118 to +134
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Resolve release version
id: version
shell: bash
run: |
VERSION="$(node -p "require('./package.json').version")"
TAURI_VERSION="$(node -e "const fs=require('fs'); console.log(JSON.parse(fs.readFileSync('src-tauri/tauri.conf.json','utf8')).version)")"
if [ "$VERSION" != "$TAURI_VERSION" ]; then
echo "::error::package.json version ($VERSION) does not match src-tauri/tauri.conf.json version ($TAURI_VERSION)."
exit 1
fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "tag=v$VERSION" >> "$GITHUB_OUTPUT"
Comment thread .github/workflows/release.yml Outdated
Comment on lines +226 to +228
while IFS= read -r -d '' file; do
gh release upload "$TAG" "$file" --clobber
done < <(find release-assets -type f -print0)
@YuyangXueEd
YuyangXueEd merged commit 521cbfa into main May 31, 2026
3 checks passed
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.

3 participants