-
Notifications
You must be signed in to change notification settings - Fork 492
Add legacy desktop CD workflow for 0.0.x releases #3216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
✅ Deploy Preview for hyprnote ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for howto-fix-macos-audio-selection canceled.
|
✅ Deploy Preview for hyprnote-storybook canceled.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # Get the latest 0.0.x tag | ||
| LATEST_TAG=$(git tag -l 'desktop_v0.0.*' --sort=-v:refname | head -n1) | ||
| echo "Latest legacy tag: $LATEST_TAG" | ||
|
|
||
| # Extract version number and increment patch | ||
| CURRENT_VERSION=$(echo "$LATEST_TAG" | sed 's/desktop_v//') | ||
| MAJOR=$(echo "$CURRENT_VERSION" | cut -d. -f1) | ||
| MINOR=$(echo "$CURRENT_VERSION" | cut -d. -f2) | ||
| PATCH=$(echo "$CURRENT_VERSION" | cut -d. -f3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing validation for empty LATEST_TAG will cause workflow failure. If no tags matching desktop_v0.0.* exist, LATEST_TAG will be empty, causing the subsequent sed and cut commands to fail or produce invalid values for MAJOR, MINOR, and PATCH.
Fix by adding validation:
LATEST_TAG=$(git tag -l 'desktop_v0.0.*' --sort=-v:refname | head -n1)
if [[ -z "$LATEST_TAG" ]]; then
echo "Error: No desktop_v0.0.* tags found" >&2
exit 1
fi
echo "Latest legacy tag: $LATEST_TAG"| # Get the latest 0.0.x tag | |
| LATEST_TAG=$(git tag -l 'desktop_v0.0.*' --sort=-v:refname | head -n1) | |
| echo "Latest legacy tag: $LATEST_TAG" | |
| # Extract version number and increment patch | |
| CURRENT_VERSION=$(echo "$LATEST_TAG" | sed 's/desktop_v//') | |
| MAJOR=$(echo "$CURRENT_VERSION" | cut -d. -f1) | |
| MINOR=$(echo "$CURRENT_VERSION" | cut -d. -f2) | |
| PATCH=$(echo "$CURRENT_VERSION" | cut -d. -f3) | |
| # Get the latest 0.0.x tag | |
| LATEST_TAG=$(git tag -l 'desktop_v0.0.*' --sort=-v:refname | head -n1) | |
| if [[ -z "$LATEST_TAG" ]]; then | |
| echo "Error: No desktop_v0.0.* tags found" >&2 | |
| exit 1 | |
| fi | |
| echo "Latest legacy tag: $LATEST_TAG" | |
| # Extract version number and increment patch | |
| CURRENT_VERSION=$(echo "$LATEST_TAG" | sed 's/desktop_v//') | |
| MAJOR=$(echo "$CURRENT_VERSION" | cut -d. -f1) | |
| MINOR=$(echo "$CURRENT_VERSION" | cut -d. -f2) | |
| PATCH=$(echo "$CURRENT_VERSION" | cut -d. -f3) |
Spotted by Graphite Agent
Is this helpful? React 👍 or 👎 to let us know.
Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| LATEST_TAG=$(git tag -l 'desktop_v0.0.*' --sort=-v:refname | head -n1) | ||
| if [[ -z "$LATEST_TAG" ]]; then | ||
| echo "Error: No desktop_v0.0.* tags found" >&2 | ||
| exit 1 | ||
| fi | ||
| echo "Latest legacy tag: $LATEST_TAG" | ||
|
|
||
| # Extract version number and increment patch | ||
| CURRENT_VERSION=$(echo "$LATEST_TAG" | sed 's/desktop_v//') | ||
| MAJOR=$(echo "$CURRENT_VERSION" | cut -d. -f1) | ||
| MINOR=$(echo "$CURRENT_VERSION" | cut -d. -f2) | ||
| PATCH=$(echo "$CURRENT_VERSION" | cut -d. -f3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 Version computation incorrectly increments patch when nightly tags exist
The version computation logic on line 43 uses git tag -l 'desktop_v0.0.*' which matches BOTH stable tags (e.g., desktop_v0.0.83) and nightly tags (e.g., desktop_v0.0.84-nightly.1). After a nightly release is created, the nightly tag will sort higher than the stable tag due to version sorting (0.0.84-nightly.1 > 0.0.83).
When this happens:
LATEST_TAGbecomesdesktop_v0.0.84-nightly.1PATCHis extracted as84-nightly(line 54:cut -d. -f3)- Bash arithmetic strips the suffix, making
PATCH=84 - For a subsequent nightly:
NEW_PATCH=85, producing version0.0.85-nightly.1(wrong - should be0.0.84-nightly.2) - For a stable release:
NEW_PATCH=85, producing version0.0.85(wrong - should be0.0.84)
This causes version numbers to skip unexpectedly after any nightly release, breaking the sequential versioning scheme.
Recommendation: Filter to only stable tags when getting the latest version base. Change line 43 to: LATEST_TAG=$(git tag -l 'desktop_v0.0.*' --sort=-v:refname | grep -v '\-nightly' | head -n1) to exclude nightly tags from consideration.
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
Adds a new GitHub Actions workflow (
desktop_cd_legacy.yaml) to support releasing legacy Hyprnote 0.0.x versions. This workflow:legacy/0.0.xbranch (created fromdesktop_v0.0.83tag)fastrepl/hyprnote(nothyprnote2)desktop.hyprnote.comupdate endpoint (notdesktop2.hyprnote.com)desktop_v0.0.*tags onlyThe next stable release from this workflow will be
desktop_v0.0.84.Review & Testing Checklist for Human
env.LEGACY_BRANCHworks in checkout steps - GitHub Actions may not expand environment variables in all contexts. Consider hardcodinglegacy/0.0.xin checkoutref:fields if this fails.s3://hyprnote-cache2/v0/binaries/sttfor the sidecar binary. Confirm this legacy binary still exists.stagingchannel to verify the build works before attempting a real release.fastrepl/hyprnoteis still active - The legacy app needs to be configured to accept uploads.Notes
legacy/0.0.xbranch has been created and pushed to originLink to Devin run: https://app.devin.ai/sessions/b29a100ce2974cf59a9cad23a4dcf09d
Requested by: @yujonglee