export CHANGELOG_GITHUB_TOKEN=token0.3.5 should always be the previous release as it's the last pyhs100 release in HISTORY.md which is the changelog prior to github release notes.
export NEW_RELEASE=x.x.x.devxgit checkout master
git fetch upstream master
git rebase upstream/master
git checkout -b release/$NEW_RELEASEsed -i "0,/version = /{s/version = .*/version = \"${NEW_RELEASE}\"/}" pyproject.tomluv sync --all-extras
uv lock --upgrade
uv sync --all-extrasuv run pre-commit run --all-files
uv run pytest -n autoWrite a short and understandable summary for the release. Can include images.
If not already created
gh issue create --label "release-summary" --milestone $NEW_RELEASE --title "$NEW_RELEASE Release Summary" --body "**Release summary:**"You can exclude the --body option to get an interactive editor or go into the issue on github and edit there.
Either via github or:
gh issue close ISSUE_NUMBERConfiguration settings are in .github_changelog_generator
EXCLUDE_TAGS will exclude all dev tags except for the current release dev tags.
Regex should be something like this ^((?!0\.7\.0)(.*dev\d))+. The first match group negative matches on the current release and the second matches on releases ending with dev.
EXCLUDE_TAGS=${NEW_RELEASE%.dev*}; EXCLUDE_TAGS=${EXCLUDE_TAGS//"."/"\."}; EXCLUDE_TAGS="^((?!"$EXCLUDE_TAGS")(.*dev\d))+"
echo "$EXCLUDE_TAGS"
github_changelog_generator --future-release $NEW_RELEASE --exclude-tags-regex "$EXCLUDE_TAGS"github_changelog_generator --future-release $NEW_RELEASE --exclude-tags-regex 'dev\d$'You can ignore warnings about missing PR commits like below as these relate to PRs to branches other than master:
Warning: PR 908 merge commit was not found in the release branch or tagged git history and no rebased SHA comment was found
export RELEASE_NOTES=$(grep -Poz '(?<=\# Changelog\n\n)(.|\n)+?(?=\#\#)' CHANGELOG.md | tr '\0' '\n' )
echo "$RELEASE_NOTES" # Check the output and copy paste if neccessarygit commit --all --verbose -m "Prepare $NEW_RELEASE"
git push upstream release/$NEW_RELEASE -ugh pr create --title "Prepare $NEW_RELEASE" --body "$RELEASE_NOTES" --label release-prep --base master
Create a squash commit and add the markdown from the PR description to the commit description.
gh pr merge --squash --body "$RELEASE_NOTES"git checkout master
git fetch upstream master
git rebase upstream/masterNote, add changelog release notes as the tag commit message so gh release create --notes-from-tag can be used to create a release draft.
git tag --annotate $NEW_RELEASE -m "$RELEASE_NOTES"
git push upstream $NEW_RELEASEgh release create "$NEW_RELEASE" --verify-tag --notes-from-tag --title "$NEW_RELEASE" --draft --latest=false --prerelease
gh release create "$NEW_RELEASE" --verify-tag --notes-from-tag --title "$NEW_RELEASE" --draft --latest=trueGo to the linked URL, verify the contents, and click "release" button to trigger the release CI.
This requires git commit signing to be enabled.
export NEW_RELEASE=x.x.x.x
export CURRENT_RELEASE=x.x.xgit fetch upstream $CURRENT_RELEASE
git checkout patch
git fetch upstream patch
git rebase upstream/patch
git fetch upstream $CURRENT_RELEASE
git merge $CURRENT_RELEASE --ff-only
git push upstream patch -u
git checkout -b release/$NEW_RELEASEexport NEW_RELEASE=x.x.x.xgit checkout patch
git fetch upstream patch
git rebase upstream/patch
git checkout -b release/$NEW_RELEASEgit cherry-pick commitSHA1 -S
git cherry-pick commitSHA2 -Ssed -i "0,/version = /{s/version = .*/version = \"${NEW_RELEASE}\"/}" pyproject.tomlgithub_changlog generator_does not work with patch releases so manually add the section for the new release to CHANGELOG.md.
export RELEASE_NOTES=$(grep -Poz '(?<=\# Changelog\n\n)(.|\n)+?(?=\#\#)' CHANGELOG.md | tr '\0' '\n' )
echo "$RELEASE_NOTES" # Check the output and copy paste if neccessarygit commit --all --verbose -m "Prepare $NEW_RELEASE" -S
git push upstream release/$NEW_RELEASE -ugh pr create --title "$NEW_RELEASE" --body "$RELEASE_NOTES" --label release-prep --base patch
Create a merge commit and add the markdown from the PR description to the commit description.
gh pr merge --merge --body "$RELEASE_NOTES"git checkout patch
git fetch upstream patch
git rebase upstream/patchgit tag -s --annotate $NEW_RELEASE -m "$RELEASE_NOTES"
git push upstream $NEW_RELEASEgh release create "$NEW_RELEASE" --verify-tag --notes-from-tag --title "$NEW_RELEASE" --draft --latest=trueThen go into github, review and release
git checkout master
git fetch upstream master
git rebase upstream/master
git checkout -b janitor/merge_patch
git fetch upstream patch
git merge upstream/patch --no-commit
git diff --name-only --diff-filter=U | xargs git checkout upstream/master
git diff --staged
# The only diff should be the version in pyproject.toml and CHANGELOG.md
# unless a change made on patch that was not part of a cherry-pick commit
# If there are any other unexpected diffs `git checkout upstream/master [thefilename]`
git commit -m "Merge patch into local master" -S
git push upstream janitor/merge_patch -u
gh pr create --title "Merge patch into master" --body '' --label release-prep --base master- Open repository settings
- From the left select
Rules>Rulesets - Open
masterruleset, underBypass listselect+ Add bypass - Check
Repository admin>Add selected, selectSave changes
gh pr merge --merge --body ""- Under
Bypass listselect...next toRepository admins Delete bypass, selectSave changes