Automate draft release publication from main CI - #2
Merged
Conversation
There was a problem hiding this comment.
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-releasejob that runs after the matrix build onmainpushes /workflow_dispatch. - Resolve and validate the release version/tag from
package.jsonandsrc-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 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 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) |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Notes
Validation