这是indexloc提供的服务,不要输入任何密码
Skip to content

Add nox session for creating release commits #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 24, 2025

Conversation

tmager
Copy link
Contributor

@tmager tmager commented Jul 13, 2025

Adds a new nox session, make_release, which takes a version number as an argument, updates the changelog, and pushes a release branch and tag for that version based on the current commit. All of the interactions with git are automated, but creating a PR to merge the release branch back to main requires a manual step for now, as AFAIK there's not a nice way to do it without also requiring GitHub credentials.

There are a few sanity checks in place to make sure this release process doesn't do anything bad:

  • It will refuse to do anything if the repo is dirty or has untracked files, as these changes could be lost or unintentionally included in the release.
  • It fetches from origin and checks that the release tag/branch being created doesn't already exist. There is technically a narrow window where two people could make the same release simultaneously, but GitHub should reject the second push anyway.
  • It will only allow releases when the current branch is main; prerelease versions skip this check at present, as we could potentially want to make dev releases on side branches. If we in future want to enable making releases from stable branches (to patch old versions), that should be straightforward to exclude from this check as well.

We don't yet have a pipeline in place for automatically making a release when a tag is pushed, but this is a step towards mostly-automated releases.

@tmager tmager requested a review from Maegereg July 13, 2025 00:12
@tmager tmager self-assigned this Jul 13, 2025
@tmager tmager force-pushed the tmager/release-scripting branch from e5be8a0 to b4d71d1 Compare July 19, 2025 19:53
Adds a new nox session, `make_release`, which takes a version number as an
argument, updates the changelog, and pushes a release branch and tag for that
version based on the current commit. All of the interactions with git are
automated, but creating a PR to merge the release branch back to main requires a
manual step for now, as AFAIK there's not a nice way to do it without also
requiring GitHub credentials.

There are a few sanity checks in place to make sure this release process doesn't
do anything bad:
- It will refuse to do anything if the repo is dirty or has untracked files, as
  these changes could be lost or unintentionally included in the release.
- It fetches from `origin` and checks that the release tag/branch being created
  doesn't already exist. There is technically a narrow window where two people
  could make the same release simultaneously, but GitHub should reject the
  second push anyway.
- It will only allow releases when the current branch is `main`; prerelease
  versions skip this check at present, as we could potentially want to make dev
  releases on side branches. If we in future want to enable making releases from
  stable branches (to patch old versions), that should be straightforward to
  exclude from this check as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants