Refactor/history cleanup#111
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
This PR refactors the project’s release/update infrastructure to keep main free of release-automation commits by generating version-bump “release commits” on a dedicated releases branch, and to serve Sparkle update metadata from a dedicated appcast branch.
Changes:
- Update the reusable version workflow to create a detached release commit, force-move the
releasesbranch to it, and force-update the version tag to the same commit. - Point Sparkle’s
SUFeedURLatraw.githubusercontent.com/.../appcast/appcast.xml(newappcastbranch). - Update the appcast updater workflow to check out the
appcastbranch before modifyingappcast.xml.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
appcast.xml |
Removes appcast from the default branch to support serving update metadata from appcast. |
MiddleDrag/Info.plist |
Updates Sparkle feed URL to the new appcast branch path. |
.github/workflows/update-appcast.yml |
Checks out appcast branch so appcast updates land on that branch. |
.github/workflows/_get-version.yml |
Generates version-bump release commits on releases and force-updates version tags. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
.github/workflows/_get-version.yml
Outdated
| # Save the main branch commit SHA as the base | ||
| BASE_SHA=$(git rev-parse HEAD) | ||
|
|
||
| git fetch origin "$BRANCH_NAME" | ||
| git checkout -b "version-bump-$VERSION" | ||
| # Create a detached release commit based on current main content | ||
| git checkout --detach HEAD |
There was a problem hiding this comment.
BASE_SHA is assigned but never used, and the accompanying comments suggest this is based on main even though the workflow is operating on the currently checked-out ref. Either remove BASE_SHA/update the comments, or explicitly check out/fetch main if that’s the intended base for the release commit.
| # Point the releases branch at this commit | ||
| git branch -f releases HEAD | ||
| git push origin releases --force | ||
|
|
||
| git push origin "$BRANCH_NAME" --force-with-lease | ||
| # Re-create the tag to point to the release commit |
There was a problem hiding this comment.
This workflow force-pushes the releases branch (and later the version tag) without any concurrency guard. If two release runs overlap, they can race and move releases/vX.Y.Z unexpectedly. Consider adding a concurrency group to the release workflow and/or using --force-with-lease to reduce the chance of clobbering another run’s updates.
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| token: ${{ steps.app-token.outputs.token }} | ||
| ref: appcast | ||
|
|
There was a problem hiding this comment.
Checking out ref: appcast will fail if the appcast branch doesn’t already exist, and after this PR the app’s SUFeedURL depends on that branch hosting appcast.xml. To make the workflow/self-update path robust, consider creating the branch automatically when missing (e.g., create an orphan branch and initial appcast.xml), or document/enforce the branch prerequisite as part of the release process.
a02db8e to
9d246d7
Compare
This pull request updates the release and versioning workflow to create release commits on a dedicated
releasesbranch instead of directly updatingmain, and adjusts the appcast update process and Sparkle feed URL to use a newappcastbranch. These changes help separate stable release artifacts from development, improving release management and update delivery.Release workflow improvements:
.github/workflows/_get-version.ymlnow creates release commits on areleasesbranch, leavingmainuntouched, and force-pushes both the branch and version tag to point to the new release commit. This also includes an inline version bump and validation step, replacing the previous script-based approach.Appcast and update feed changes:
MiddleDrag/Info.plistis updated to point to theappcastbranch instead ofmain, ensuring that update metadata is served from a stable, release-only branch.update-appcast.ymlworkflow now checks out theappcastbranch when updating the appcast file, aligning with the new feed URL and branch strategy.