Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ Releases use a version pull request followed by a separate publish step:

```sh
./scripts/release.sh minor
# Merge the generated pull request after CI passes.
# The generated release pull request auto-merges after required CI passes.
git switch main
git pull --ff-only
./scripts/release.sh publish
```

The bump command requires a clean `main` matching `origin/main`, creates `chore/release-vX.Y.Z`, updates both version files and `CHANGELOG.md`, and opens a pull request. After that pull request merges, `publish` tags the current version without incrementing it. Publication refuses a stale changelog, so commits added after release preparation require a pull request that refreshes `CHANGELOG.md`. The tag-triggered release workflow reruns the shell suite and shellcheck, validates SemVer, requires the tagged commit to belong to `main`, verifies the tag matches both version files, builds the archive and checksum, and creates the GitHub Release. Pass `--run-tests` to either command for an extra local preflight. You do not need to touch `VERSION` or `CHANGELOG.md` in a normal pull request.
The bump command requires a clean `main` matching `origin/main`, creates `chore/release-vX.Y.Z`, updates both version files and `CHANGELOG.md`, opens a pull request, and enables auto-merge for that release pull request only. GitHub merges it after the required CI checks pass. After that pull request merges, `publish` tags the current version without incrementing it. Publication refuses a stale changelog, so commits added after release preparation require a pull request that refreshes `CHANGELOG.md`. The tag-triggered release workflow reruns the shell suite and shellcheck, validates SemVer, requires the tagged commit to belong to `main`, verifies the tag matches both version files, builds the archive and checksum, and creates the GitHub Release. Pass `--run-tests` to either command for an extra local preflight. You do not need to touch `VERSION` or `CHANGELOG.md` in a normal pull request.

## Reporting bugs and proposing features

Expand Down
4 changes: 3 additions & 1 deletion scripts/devloop_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1863,6 +1863,7 @@ ok "pure helpers"
contains "$dry_run_output" "would create branch: chore/release-v9.9.10" "release dry-run"
contains "$dry_run_output" "would update VERSION, site/public/VERSION, and CHANGELOG.md" "release dry-run"
contains "$dry_run_output" "would open pull request: chore: release 9.9.10" "release dry-run"
contains "$dry_run_output" "would enable auto-merge after required CI passes" "release dry-run"
contains "$dry_run_output" "pull request CI remains authoritative" "release dry-run"
test_dry_run_output="$(release_main "patch" --run-tests --dry-run)" || fail "release test dry-run failed"
contains "$test_dry_run_output" "would run bash scripts/devloop_test.sh" "release test dry-run"
Expand Down Expand Up @@ -1949,7 +1950,8 @@ GH
contains "$(cat "$ROOT/CHANGELOG.md")" "- feat: initial release fixture" "release pull request changelog"
contains "$(cat "$release_gh_log")" "pr create --base main --head chore/release-v9.9.10" "release pull request creation"
contains "$(cat "$release_gh_log")" "./scripts/release.sh publish" "release pull request instructions"
contains "$release_prepare_output" "opened release pull request for v9.9.10" "release pull request output"
contains "$(cat "$release_gh_log")" "pr merge https://example.test/release-pr --auto --merge" "release pull request auto-merge"
contains "$release_prepare_output" "enabled auto-merge for v9.9.10 after required CI passes" "release pull request output"
if git -C "$ROOT" rev-parse -q --verify refs/tags/v9.9.10 >/dev/null; then fail "release pull request left a local tag"; fi
git -C "$ROOT" ls-remote --exit-code --heads origin refs/heads/chore/release-v9.9.10 >/dev/null || fail "release pull request branch was not pushed"

Expand Down
11 changes: 7 additions & 4 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ usage:

Release flow:
1. Run patch, minor, or major to open a version-bump pull request.
2. Merge the pull request after CI passes.
2. The release pull request merges automatically after required CI passes.
3. Run publish from main to push the existing version tag.
4. GitHub Actions builds the assets and creates the GitHub Release.

Expand Down Expand Up @@ -302,7 +302,7 @@ release_prepare_pr() {
local bump="$1"
local dry_run="$2"
local run_tests="$3"
local current version tag branch title
local current version tag branch title pr_url

current="$(release_current_version)"
version="$(release_next_version "$bump" "$current")" || return $?
Expand All @@ -323,6 +323,7 @@ release_prepare_pr() {
fi
printf 'would commit: %s\n' "$title"
printf 'would open pull request: %s\n' "$title"
printf '%s\n' "would enable auto-merge after required CI passes"
return 0
fi

Expand Down Expand Up @@ -350,8 +351,10 @@ release_prepare_pr() {
fi

git -C "$ROOT" push -u origin "$branch" || return $?
gh pr create --base main --head "$branch" --title "$title" --body "$(release_pr_body "$version")" || return $?
printf 'opened release pull request for %s\n' "$tag"
pr_url="$(gh pr create --base main --head "$branch" --title "$title" --body "$(release_pr_body "$version")")" || return $?
printf '%s\n' "$pr_url"
gh pr merge "$pr_url" --auto --merge || return $?
printf 'enabled auto-merge for %s after required CI passes\n' "$tag"
}

release_publish() {
Expand Down
Loading