ci(release): one-click pre-releases for anyone with write access, and docs/releasing.md #2010
Closed
NotRexed wants to merge 2 commits from
ci/prereleases into main
pull from: ci/prereleases
merge into: MagicBeanDev:main
MagicBeanDev:main
MagicBeanDev:github/pr/2893
MagicBeanDev:github/pr/2890
MagicBeanDev:github/pr/2887
MagicBeanDev:github/pr/2878
MagicBeanDev:github/pr/2875
MagicBeanDev:github/pr/2874
MagicBeanDev:github/pr/2873
MagicBeanDev:github/pr/2871
MagicBeanDev:github/pr/2756
MagicBeanDev:github/pr/2897
MagicBeanDev:github/pr/2896
MagicBeanDev:github/pr/2718
MagicBeanDev:github/pr/2842
MagicBeanDev:github/pr/2691
MagicBeanDev:github/pr/2895
MagicBeanDev:github/pr/2743
MagicBeanDev:github/pr/2765
MagicBeanDev:github/pr/2708
MagicBeanDev:github/pr/2732
MagicBeanDev:github/pr/2755
MagicBeanDev:github/pr/2817
MagicBeanDev:github/pr/2876
MagicBeanDev:release-please--branches--main
MagicBeanDev:release-please--branches--main--release-notes
MagicBeanDev:github/pr/2778
MagicBeanDev:github/pr/2888
MagicBeanDev:github/pr/2866
MagicBeanDev:github/pr/2877
MagicBeanDev:github/pr/2800
MagicBeanDev:github/pr/2829
MagicBeanDev:github/pr/2850
MagicBeanDev:github/pr/2889
MagicBeanDev:github/pr/2882
MagicBeanDev:github/pr/2860
MagicBeanDev:github/pr/2849
MagicBeanDev:github/pr/2886
MagicBeanDev:github/pr/2794
MagicBeanDev:github/pr/2840
MagicBeanDev:github/pr/2830
MagicBeanDev:github/pr/2834
MagicBeanDev:github/pr/2719
MagicBeanDev:github/pr/2742
MagicBeanDev:github/pr/2741
MagicBeanDev:github/pr/2820
MagicBeanDev:github/pr/2771
MagicBeanDev:github/pr/2859
MagicBeanDev:github/pr/2858
MagicBeanDev:github/pr/2823
MagicBeanDev:github/pr/2757
MagicBeanDev:github/pr/2769
MagicBeanDev:github/pr/2844
MagicBeanDev:github/pr/2843
MagicBeanDev:github/pr/2673
MagicBeanDev:github/pr/2855
MagicBeanDev:github/pr/2739
MagicBeanDev:github/pr/2807
MagicBeanDev:github/pr/2851
MagicBeanDev:github/pr/2789
MagicBeanDev:github/pr/2814
MagicBeanDev:github/pr/2818
MagicBeanDev:github/pr/2774
MagicBeanDev:github/pr/2772
MagicBeanDev:github/pr/2750
MagicBeanDev:github/pr/2786
MagicBeanDev:github/pr/2785
MagicBeanDev:github/pr/2782
MagicBeanDev:github/pr/2779
MagicBeanDev:github/pr/2775
MagicBeanDev:github/pr/2706
MagicBeanDev:github/pr/2766
MagicBeanDev:github/pr/2747
MagicBeanDev:github/pr/2759
MagicBeanDev:github/pr/2745
MagicBeanDev:github/pr/2740
MagicBeanDev:github/pr/2733
MagicBeanDev:github/pr/2725
MagicBeanDev:github/pr/2727
MagicBeanDev:github/pr/2728
MagicBeanDev:github/pr/2729
MagicBeanDev:github/pr/2721
MagicBeanDev:github/pr/2722
MagicBeanDev:github/pr/2715
MagicBeanDev:github/pr/2714
MagicBeanDev:github/pr/2707
MagicBeanDev:github/pr/2703
MagicBeanDev:github/pr/2705
MagicBeanDev:github/pr/2697
MagicBeanDev:github/pr/2679
MagicBeanDev:github/pr/2676
MagicBeanDev:github/pr/2669
MagicBeanDev:docs/what-hookshot-connects-to
MagicBeanDev:fix/hdr-encode-test
MagicBeanDev:fix/main-tests
MagicBeanDev:fix/play-cache-files
MagicBeanDev:perf/game-barrier-order
MagicBeanDev:feat/heap-lazy
MagicBeanDev:feat/texture-detail
MagicBeanDev:perf/astc-opaque-bc1
MagicBeanDev:fix/fs-dir-lock
MagicBeanDev:fix/framegen-native-kept
MagicBeanDev:fix/update-no-downgrade
MagicBeanDev:port/k10-gcn-f16-mirrors
MagicBeanDev:fix/framegen-mult-cap
MagicBeanDev:chore/release-as-2.1.1
MagicBeanDev:perf/pcache-load-switch
MagicBeanDev:fix/prepare-progress-log
MagicBeanDev:fix/update-closes-stale-game
MagicBeanDev:fix/hdr-scaled-sampled
MagicBeanDev:perf/first-start-preset
MagicBeanDev:perf/zero-upload
MagicBeanDev:fix/vcore-escape-2s
MagicBeanDev:test/fake-gh-atomic
MagicBeanDev:perf/batch-idle-flush
MagicBeanDev:test/finish-stub-a
MagicBeanDev:chore/record-2.1.0
MagicBeanDev:fix/main-red-tests
MagicBeanDev:fix/test-display-startup-driver-cache
MagicBeanDev:feat/mesh-shader-mode
MagicBeanDev:fix/menu-probes-at-startup
MagicBeanDev:fix/fps-counter-classic
MagicBeanDev:fix/test-log-batch-flake
MagicBeanDev:fix/narrow-screen-hud
MagicBeanDev:release/v2.0.15
MagicBeanDev:hotfix/v2.0.15
MagicBeanDev:fix/present-ahead-replay
MagicBeanDev:release/v2.0.13
MagicBeanDev:fix/bracket-paths-2013
MagicBeanDev:fix/hdr-overlays-2013
MagicBeanDev:fix/fps-counter-scale-2013
MagicBeanDev:fix/stick-seen-at-rest
MagicBeanDev:hotfix/menu-fits-screen
MagicBeanDev:fix/f1-always-opens-menu
MagicBeanDev:fix/ini-keep-lines
MagicBeanDev:claude/cranky-pike-7cf247
MagicBeanDev:perf/texture-answer-flat
MagicBeanDev:fix/stamp-test-modules
MagicBeanDev:fix/appimage-fonts
MagicBeanDev:fix/display-awake
MagicBeanDev:release/v2.0.12
MagicBeanDev:fix/discord-windows
MagicBeanDev:rc/v2.0.12-tests
MagicBeanDev:fix/dlss-keep-feature
MagicBeanDev:rc/v2.0.12
MagicBeanDev:button-icons
No reviewers
Labels
Clear labels
accessibility
Barrier affecting people with disabilities
autorelease: pending
autorelease: tagged
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
github_actions
Pull requests that update GitHub Actions code
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
question
Further information is requested
testing wanted
wontfix
This will not be worked on
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!2010
Loading…
Reference in a new issue
No description provided.
Delete branch "ci/prereleases"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Releases are too slow: there's a day of merged work on main that no player has. This makes pre-releases a button, and writes the release process down. It's meant to land after #1059, which turns the Windows release job on by default. Before #1059, a pre-release would get the AppImage but no
HookshotBuilder.exe.Actions > Pre-release > Run workflow, for anyone with write access:
vX.Y.Z-rc.Nfor the branch's head (scripts/next_prerelease.sh):main(the default) counts from the patch after the newest stable tag;release/vX.Y.Zbranch uses its own version;GITHUB_TOKENstarts no workflows, but aworkflow_dispatchdoes, so no personal token is needed.scripts/release_upload.sh). The in-game update offer and the Builder's update only ask for "latest", so players aren't moved onto it; testers download from the release page.Options:
PRERELEASE_NIGHTLYistrue; it's off unless set.docs/releasing.mdcovers:release/vX.Y.Zbranch, its pre-release, and the stable tag on the tested commit.Tested:
scripts/next_prerelease.shlocally:v2.0.15-rc.1v2.0.15-rc.1The workflow itself runs for the first time after merge; its dry run is the safe first try.
🤖 Generated with Claude Code
Nice, a one-click pre-release is a real gap filled. I went through the workflow, the script and the doc against main as it is now (release.yml with release-please from #1059, windows-builder.yml, linux-appimage.yml, release_upload.sh).
What holds up:
workflow_dispatchplus aschedulegated onvars.PRERELEASE_NIGHTLY. Nopull_request*trigger, so a fork or outside PR can't start it; dispatch needs write access.contents: readat the top, withcontents: write+actions: writeonly on the one job.persist-credentials: false, and the token is only inenvforgh. Least-privilege as far as I can see.inputs.branchreaches the shell only through$BRANCH.${{ steps.next.outputs.tag }}is interpolated intorun:, but its value comes out of the script's regexes (digits and dots only), so it's safe today (nit inline).github.ref=refs/tags/<tag>, soRELEASE_TAGis set, the Windowsreleasejob runs (it's on by default since #1059), andrelease_upload.shmakes it--prerelease --latest=false.release_parts.py previousskips prereleases, so the next builds don't take their setup list from an rc.prereleaseconcurrency group serializes runs, andPOST git/refson an existing tag fails (422) underset -euo pipefail, so two runs can't produce the same tag. actionlint passes. The rest of CI is green; Python source checks (windows-2022) is still pending.Things to fix or decide:
shell: bash, arun:step usesbash -e {0}with no pipefail, sonext_prerelease.sh | teeis green even when the script exits 1 (for example "no stable vX.Y.Z tag"). The next step then runs with an empty tag: a dry run reports "would tag ... as " and passes, and a real run fails at the refs POST with an unclear error.branchisn't checked. Any ref is accepted (a feature branch, a tag, a SHA). Anything that isn'trelease/vX.Y.Zgets main's nextvX.Y.0-rc.N, so a typo or a feature branch takes main's next rc number and puts out a pre-release of unreviewed code. A regex guard (^(main|release/v[0-9]+\.[0-9]+\.[0-9]+)$) would match what the input description and the doc say.gh workflow runfails (an API blip, say), re-running skips because the head already has an rc tag, and the builds never start. Either dispatch on the skip path when the tag has no release yet, or add the manual recovery to the doc (gh workflow run windows-builder.yml --ref <tag>, the same for linux-appimage.yml).release-as: 2.1.0, but once that's removed, release-please picks patch or minor from the PR titles. A fix-only cycle would put out2.2.0-rc.Npre-releases followed by a stable2.1.1. It may be fine to accept that and say so in the doc, or the script could take the version from release-please's open release PR or the manifest.host/hos_update.c) only checks that the folder's version differs from latest's. A folder built fromv2.1.0-rc.1is therefore offered "A new version of Hookshot is out: v2.0.14" on every launch until they pick "skip this version". That was already true for hand-pushed rc's, but pre-releases become routine with this PR (and nightly ones if the variable is on).Description: it says main "counts from the patch after the newest stable tag", and the test table shows main ->
v2.0.15-rc.1. The second commit (90fa1644) changed that to the next minor (v2.1.0-rc.1), which the doc and the script's header already say. Worth updating the body and the table. The "land after #1059" condition is met now, since #1059 merged today.Overlap with #1059 / #1062: no conflict. #1059 as merged has only release-please, the build
workflow_calls and the publish job. This adds a separate workflow and touches none of those files. #1062 (rollingnightlyprerelease) is closed. Its closing note says it was folded into #1059, but the merged #1059 has no nightly or Promote flow, soPRERELEASE_NIGHTLYhere is the only nightly path on main. If the rollingnightlycomes back later, pick one of the two rather than run both.Hotfix flow and the rest of the doc match what the workflows do.
@ -0,0 +41,4 @@env:GH_TOKEN: ${{ github.token }}GH_REPO: ${{ github.repository }}BRANCH: ${{ inputs.branch || 'main' }}Nothing limits this to
main/release/vX.Y.Z. Any other branch (or a tag or SHA, which checkout also accepts) gets main's next rc number. Maybe a first step:[[ $BRANCH =~ ^(main|release/v[0-9]+\.[0-9]+\.[0-9]+)$ ]] || { echo "::error::..."; exit 1; }.@ -0,0 +52,4 @@persist-credentials: false- name: Next pre-release tagid: nextrun: scripts/next_prerelease.sh "$BRANCH" | tee -a "$GITHUB_OUTPUT"With no
shell:set, this runs asbash -e {0}(no pipefail), soteehides a failing script: the step passes andoutputs.tagis empty. Addingshell: bashhere (that's-eo pipefail), or a job-leveldefaults: run: shell: bash, fixes it.@ -0,0 +57,4 @@if: steps.next.outputs.skip != 'true'run: |set -euo pipefailtag='${{ steps.next.outputs.tag }}'Nit: safe today, because the value is digits and dots from the script's regexes. Passing it as
env: TAG: ${{ steps.next.outputs.tag }}would keep every${{ }}out ofrun:, which is what theBRANCHinput already does.@ -0,0 +64,4 @@exit 0figh api -X POST "repos/$GH_REPO/git/refs" -f ref="refs/tags/$tag" -f sha="$sha" >/dev/nullgh workflow run windows-builder.yml --ref "$tag"If this or the next dispatch fails after the tag above is made, a re-run sees the head already tagged and skips, so the builds never start. Worth either dispatching on the skip path when
gh release view "$tag"finds nothing, or a recovery line in docs/releasing.md.@ -0,0 +28,4 @@reports on Discord or GitHub.2. **The owner tests it**: a full local build from the same commit, played with nothing else running. Nothing becomesstable without that.3. Merge release-please's open release PR (`chore: release <version>`), after editing its changelog entry if needed.release-please tags the merge commit of its PR: main's head at merge time. If anything landed after the tested pre-release, it goes stable without the soak or step 2's test. Suggest: merge only when main hasn't moved since the tested rc (or cut a new rc and test that).
@ -0,0 +20,4 @@stable=$(git tag -l 'v[0-9]*' | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -1)[ -n "$stable" ] || { echo "no stable vX.Y.Z tag to count from" >&2; exit 1; }IFS=. read -r major minor patch <<<"${stable#v}"version="$major.$((minor + 1)).0"Always the next minor. That matches
release-as: 2.1.0now, but after that's removed, release-please may choose a patch (fix-only PR titles). Main's rc's would then be2.2.0-rc.Nbefore a stable2.1.1. Fine if intended; worth a sentence in docs/releasing.md either way.Closing in favour of #2018 (hckrman101): it does the same with release-please itself. Merging its release PR publishes a release candidate (
vX.Y.Z-rc.N), Promote publishes a tested one, and a rolling nightly of main covers the rest. Two RC schemes side by side would collide, as #2018 explains. Main's history since v2.0.14 has 29featcommits, so its first candidate is 2.1.0-rc.1, the owner's chosen next version.