Skip to content

Commit 6f59439

Browse files
committed
Use 'release-candidate' instead of 'staging'
1 parent e3c2136 commit 6f59439

2 files changed

Lines changed: 41 additions & 41 deletions

File tree

RELEASE.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ On the PR:
1515

1616
## Releasing PySCIPOpt
1717

18-
Releases run in two phases from `master`, driven by `./release.sh`. The tag and master push only happen in phase 2, so an aborted release leaves no semantic public trace — just a deletable `staging-vX.Y.Z` branch.
18+
Releases run in two phases from `master`, driven by `./release.sh`. The tag and master push only happen in phase 2, so an aborted release leaves no semantic public trace — just a deletable `release-candidate-vX.Y.Z` branch.
1919

2020
Use `--dry-run` with any command to preview without side effects.
2121

@@ -25,7 +25,7 @@ Use `--dry-run` with any command to preview without side effects.
2525
./release.sh
2626
```
2727

28-
Prompts for the version bump (patch/minor/major), updates `_version.py`, `setup.py`, and `CHANGELOG.md`, commits **locally**, pushes the commit to `staging-vX.Y.Z` on origin, and triggers the build-wheels workflow on that branch (uploads to test-pypi). **Master is not pushed, no tag is created.** The script exits as soon as the workflow is dispatched.
28+
Prompts for the version bump (patch/minor/major), updates `_version.py`, `setup.py`, and `CHANGELOG.md`, commits **locally**, pushes the commit to `release-candidate-vX.Y.Z` on origin, and triggers the build-wheels workflow on that branch (uploads to test-pypi). **Master is not pushed, no tag is created.** The script exits as soon as the workflow is dispatched.
2929

3030
To skip the bump prompt (e.g., when test-pypi has already burnt the default next version and you need to jump ahead):
3131

@@ -35,7 +35,7 @@ To skip the bump prompt (e.g., when test-pypi has already burnt the default next
3535

3636
### Manual verification
3737

38-
Once the staging workflow finishes, install from test-pypi and smoke-test:
38+
Once the release-candidate workflow finishes, install from test-pypi and smoke-test:
3939

4040
```bash
4141
pip install -i https://test.pypi.org/simple/ PySCIPOpt==X.Y.Z
@@ -49,15 +49,15 @@ If the smoke test **passes**:
4949
./release.sh --finalize
5050
```
5151

52-
Checks the staging workflow succeeded, then tags `vX.Y.Z`, pushes master, and deletes the staging branch.
52+
Checks the release-candidate workflow succeeded, then tags `vX.Y.Z`, pushes master, and deletes the release-candidate branch.
5353

5454
If the smoke test **fails** (or you change your mind):
5555

5656
```bash
5757
./release.sh --rollback
5858
```
5959

60-
Deletes the staging branch and resets the local release commit. test-pypi has already burnt the uploaded version string, so the next attempt must use `--version=` to pick a different one.
60+
Deletes the release-candidate branch and resets the local release commit. test-pypi has already burnt the uploaded version string, so the next attempt must use `--version=` to pick a different one.
6161

6262
### After finalize
6363

release.sh

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ for arg in "$@"; do
1919
cat <<USAGE
2020
Usage: $0 [--dry-run] [--version=X.Y.Z] [--finalize | --rollback]
2121
22-
(default) Start a new release: bump version, push the staging branch,
22+
(default) Start a new release: bump version, push the release-candidate branch,
2323
trigger the test-pypi build.
2424
--version=X.Y.Z Use this exact version instead of prompting for patch/minor/major.
2525
Useful if test-pypi has already burnt the default next version.
26-
--finalize Promote: tag vX.Y.Z, push master, delete the staging branch.
27-
Requires the staging workflow to have succeeded.
28-
--rollback Abandon: delete the staging branch and reset the local commit.
26+
--finalize Promote: tag vX.Y.Z, push master, delete the release-candidate branch.
27+
Requires the release-candidate workflow to have succeeded.
28+
--rollback Abandon: delete the release-candidate branch and reset the local commit.
2929
--dry-run Preview without side effects. Combinable with the flags above.
3030
USAGE
3131
exit 0
@@ -74,24 +74,24 @@ validate_version() {
7474
fi
7575
}
7676

77-
# Promote a successful pending release: tag, push master, clean up staging branch.
77+
# Promote a successful pending release: tag, push master, clean up release-candidate branch.
7878
finalize_release() {
7979
local version="$1"
80-
local staging_branch="staging-v${version}"
80+
local candidate_branch="release-candidate-v${version}"
8181

8282
echo "Pending release: v${version}"
83-
echo "Checking workflow status on ${staging_branch}..."
83+
echo "Checking workflow status on ${candidate_branch}..."
8484

8585
local run_data run_count status conclusion url run_id
8686
run_data=$(gh run list --workflow=build_wheels.yml --repo "$REPO" \
87-
--branch "$staging_branch" --limit 1 \
87+
--branch "$candidate_branch" --limit 1 \
8888
--json databaseId,status,conclusion,url 2>/dev/null || echo "[]")
8989
run_count=$(echo "$run_data" | jq 'length')
9090

9191
if [[ "$run_count" == "0" ]]; then
92-
echo "Error: no workflow run found for branch '${staging_branch}'."
92+
echo "Error: no workflow run found for branch '${candidate_branch}'."
9393
echo "Either wait a moment and try again, or clean up manually:"
94-
echo " git push ${PUSH_REMOTE} --delete ${staging_branch}"
94+
echo " git push ${PUSH_REMOTE} --delete ${candidate_branch}"
9595
echo " git reset --hard HEAD~1"
9696
exit 1
9797
fi
@@ -113,12 +113,12 @@ finalize_release() {
113113
echo "URL: ${url}"
114114
echo ""
115115
if [[ "$DRY_RUN" == true ]]; then
116-
echo "DRY RUN: would prompt to roll back (delete ${staging_branch} + reset local commit)."
116+
echo "DRY RUN: would prompt to roll back (delete ${candidate_branch} + reset local commit)."
117117
exit 0
118118
fi
119-
read -rp "Roll back (delete ${staging_branch} and reset local release commit)? [Y/n] " confirm
119+
read -rp "Roll back (delete ${candidate_branch} and reset local release commit)? [Y/n] " confirm
120120
if [[ ! "${confirm:-Y}" =~ ^[Nn] ]]; then
121-
git push "$PUSH_REMOTE" --delete "$staging_branch" || echo "(note: remote staging branch delete failed; clean up manually)"
121+
git push "$PUSH_REMOTE" --delete "$candidate_branch" || echo "(note: remote release-candidate branch delete failed; clean up manually)"
122122
git reset --hard HEAD~1
123123
echo "Rolled back. Repo is at pre-release state."
124124
fi
@@ -131,15 +131,15 @@ finalize_release() {
131131
echo " git tag v${version}"
132132
echo " git push ${PUSH_REMOTE} ${CURRENT_BRANCH}"
133133
echo " git push ${PUSH_REMOTE} v${version}"
134-
echo " git push ${PUSH_REMOTE} --delete ${staging_branch}"
134+
echo " git push ${PUSH_REMOTE} --delete ${candidate_branch}"
135135
exit 0
136136
fi
137137

138138
echo "Workflow succeeded. Promoting release v${version}..."
139139
git tag "v${version}"
140140
git push "$PUSH_REMOTE" "$CURRENT_BRANCH"
141141
git push "$PUSH_REMOTE" "v${version}"
142-
git push "$PUSH_REMOTE" --delete "$staging_branch"
142+
git push "$PUSH_REMOTE" --delete "$candidate_branch"
143143

144144
echo ""
145145
echo "Done! v${version} is now tagged on ${PUSH_REMOTE}."
@@ -154,23 +154,23 @@ finalize_release() {
154154
echo " 4. Update readthedocs: Builds -> Build version (latest and stable)"
155155
}
156156

157-
# Abandon a pending release: delete staging branch, reset local release commit.
157+
# Abandon a pending release: delete release-candidate branch, reset local release commit.
158158
rollback_release() {
159159
local version="$1"
160-
local staging_branch="staging-v${version}"
160+
local candidate_branch="release-candidate-v${version}"
161161

162162
echo "Rolling back pending release v${version}..."
163163
if [[ "$DRY_RUN" == true ]]; then
164164
echo "DRY RUN: would have run:"
165-
echo " git push ${PUSH_REMOTE} --delete ${staging_branch}"
165+
echo " git push ${PUSH_REMOTE} --delete ${candidate_branch}"
166166
echo " git reset --hard HEAD~1"
167167
exit 0
168168
fi
169169

170-
if git ls-remote --heads --exit-code "$PUSH_REMOTE" "$staging_branch" &>/dev/null; then
171-
git push "$PUSH_REMOTE" --delete "$staging_branch"
170+
if git ls-remote --heads --exit-code "$PUSH_REMOTE" "$candidate_branch" &>/dev/null; then
171+
git push "$PUSH_REMOTE" --delete "$candidate_branch"
172172
else
173-
echo "(note: ${staging_branch} already absent from ${PUSH_REMOTE})"
173+
echo "(note: ${candidate_branch} already absent from ${PUSH_REMOTE})"
174174
fi
175175
git reset --hard HEAD~1
176176
echo "Rolled back. Repo is at pre-release state."
@@ -207,8 +207,8 @@ HEAD_MSG=$(git log -1 --format=%s)
207207
if [[ "$HEAD_MSG" =~ ^release\ v([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
208208
echo "Error: HEAD is already 'release v${BASH_REMATCH[1]}' — a pending release exists."
209209
echo "Use:"
210-
echo " ./release.sh --finalize # promote (requires the staging workflow to have succeeded)"
211-
echo " ./release.sh --rollback # abandon (delete staging branch, reset local commit)"
210+
echo " ./release.sh --finalize # promote (requires the release-candidate workflow to have succeeded)"
211+
echo " ./release.sh --rollback # abandon (delete release-candidate branch, reset local commit)"
212212
exit 1
213213
fi
214214

@@ -274,7 +274,7 @@ if [[ "$UNRELEASED_BULLETS" == "0" ]]; then
274274
fi
275275

276276
TODAY=$(date +%Y.%m.%d)
277-
STAGING_BRANCH="staging-v${NEW_VERSION}"
277+
CANDIDATE_BRANCH="release-candidate-v${NEW_VERSION}"
278278
echo ""
279279
if [[ "$DRY_RUN" == true ]]; then
280280
echo "DRY RUN: This script would:"
@@ -283,13 +283,13 @@ else
283283
fi
284284
echo " 1. Update version ${CURRENT_VERSION} -> ${NEW_VERSION} in _version.py and setup.py"
285285
echo " 2. Update CHANGELOG.md (${NEW_VERSION} - ${TODAY})"
286-
echo " 3. Commit locally, push commit to branch '${STAGING_BRANCH}' on ${PUSH_REMOTE}"
286+
echo " 3. Commit locally, push commit to branch '${CANDIDATE_BRANCH}' on ${PUSH_REMOTE}"
287287
echo " (master is NOT pushed; no tag is created yet)"
288288
echo " 4. Trigger the build wheels workflow on that branch (test-pypi)"
289289
echo ""
290290
echo "Once the workflow finishes, re-run this script:"
291-
echo " - success -> tag v${NEW_VERSION}, push master, delete staging branch"
292-
echo " - failure -> prompt to roll back (delete staging branch + reset local commit)"
291+
echo " - success -> tag v${NEW_VERSION}, push master, delete release-candidate branch"
292+
echo " - failure -> prompt to roll back (delete release-candidate branch + reset local commit)"
293293
echo ""
294294
if [[ "$DRY_RUN" == false ]]; then
295295
read -rp "Proceed? [Y/n] " confirm
@@ -359,27 +359,27 @@ if [[ "$DRY_RUN" == true ]]; then
359359
echo ""
360360
echo "DRY RUN: would have run:"
361361
echo " git commit -m 'release v${NEW_VERSION}'"
362-
echo " git push ${PUSH_REMOTE} HEAD:refs/heads/${STAGING_BRANCH}"
363-
echo " gh workflow run build_wheels.yml --repo ${REPO} --ref ${STAGING_BRANCH} -f upload_to_pypi=true -f test_pypi=true"
362+
echo " git push ${PUSH_REMOTE} HEAD:refs/heads/${CANDIDATE_BRANCH}"
363+
echo " gh workflow run build_wheels.yml --repo ${REPO} --ref ${CANDIDATE_BRANCH} -f upload_to_pypi=true -f test_pypi=true"
364364
exit 0
365365
fi
366366

367-
# --- Commit locally and push staging branch (no tag, no master push yet) ---
367+
# --- Commit locally and push release-candidate branch (no tag, no master push yet) ---
368368

369369
git add "$VERSION_FILE" "$SETUP_FILE" "$CHANGELOG"
370370
git commit -m "release v${NEW_VERSION}"
371-
git push "$PUSH_REMOTE" "HEAD:refs/heads/${STAGING_BRANCH}"
371+
git push "$PUSH_REMOTE" "HEAD:refs/heads/${CANDIDATE_BRANCH}"
372372

373-
# --- Trigger test-pypi build against the staging branch ---
373+
# --- Trigger test-pypi build against the release-candidate branch ---
374374

375-
gh workflow run build_wheels.yml --repo "$REPO" --ref "$STAGING_BRANCH" -f upload_to_pypi=true -f test_pypi=true
375+
gh workflow run build_wheels.yml --repo "$REPO" --ref "$CANDIDATE_BRANCH" -f upload_to_pypi=true -f test_pypi=true
376376

377377
echo ""
378378
echo "Release candidate v${NEW_VERSION} started (phase 1 of 2):"
379379
echo " - Local: release commit on ${CURRENT_BRANCH}, NOT pushed"
380-
echo " - Remote: branch '${STAGING_BRANCH}' has the release commit"
381-
echo " - Workflow: https://github.com/${REPO}/actions?query=branch%3A${STAGING_BRANCH}"
380+
echo " - Remote: branch '${CANDIDATE_BRANCH}' has the release commit"
381+
echo " - Workflow: https://github.com/${REPO}/actions?query=branch%3A${CANDIDATE_BRANCH}"
382382
echo ""
383383
echo "Re-run this script after the workflow finishes to finalize:"
384-
echo " - success -> tag v${NEW_VERSION}, push ${CURRENT_BRANCH}, delete ${STAGING_BRANCH}"
384+
echo " - success -> tag v${NEW_VERSION}, push ${CURRENT_BRANCH}, delete ${CANDIDATE_BRANCH}"
385385
echo " - failure -> prompt to roll back"

0 commit comments

Comments
 (0)