From 899eb218d6321d4aa93eb480c649b629115f9f78 Mon Sep 17 00:00:00 2001 From: "Michael J. Williams" Date: Fri, 2 May 2025 16:25:47 +0100 Subject: [PATCH 1/4] BLD: use release branch semver --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index ce1266d75..145d905d1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -146,4 +146,5 @@ mcmc = {file = ["mcmc_requirements.txt"]} "bilby.gw.eos" = ["eos_tables/*.dat"] [tool.setuptools_scm] +"version_scheme" = "release-branch-semver" write_to = "bilby/_version.py" From 11b5f436e5b1409d65d3db61e0451b5b2fd1eb80 Mon Sep 17 00:00:00 2001 From: "Michael J. Williams" Date: Fri, 2 May 2025 16:44:35 +0100 Subject: [PATCH 2/4] DOC: update `making releases` to describe process using release branches --- CONTRIBUTING.md | 42 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d834da9de..b27fe2d33 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -324,6 +324,9 @@ The version tag should also start with `v` e.g. `v2.4.0`. `bilby` uses `setuptools_scm` to automatically set the version based on git tags. This means no manual changes are needed to the version number are required. +As on version v2.6.0, `bilby` uses a [stable mainline](https://www.bitsnbites.eu/a-stable-mainline-branching-model-for-git/) branching model for releases. +This means that all major and minor releases should have a corresponding branch `release/X.Y.x`. + ### Updating the changelog Before making a release, the [changelog](https://github.com/bilby-dev/bilby/blob/main/CHANGELOG.md) @@ -337,6 +340,40 @@ When making a changelog keep the following in mind: - Include links to the relevant PRs - Remember to update the URLs at the bottom of changelog file +### Tagging a release + +#### Major and minor releases + +If making a major or minor release you must first make the release branch from the current `main` branch + +```bash +git checkout -b release/2.6.x +git push upstream release/2.6.x +``` + +**Note:** this assume you have add the `bilby-dev/bilby` repository as `upstream` + +#### Bug-fix releases + +If making a bugfix release, the relevant commits should be cherry-picked and merged +into the release branch. + +**Note:** make sure the changelog is up-to-date. + +#### Adding the tag + +Make sure you have the release branch checked out and up-to-date, then tag the release + +```bash +git tag v2.6.0 +``` + +Once it is tagged, it should be pushed to the `bilby-dev/bilby` repository. + +```bash +git push upstream v2.6.0 +``` + ### Making the release on GitHub **Note:** releases will automatically be pushed to PyPI and versions on PyPI @@ -346,9 +383,8 @@ Once the changelog has been updated, follow these steps for making a release: 1. Navigate to https://github.com/bilby-dev/bilby/releases. 2. Click `Draft new release`. -3. Select an existing tag that does not have a release or specify the name of a -new tag that will be made when the release is made. -4. Specify the version as the title, e.g. `v2.4.0`. +3. Select an existing tag that does not have a release +4. Specify the version as the title, e.g. `v2.6.0`. 5. Copy the relevant section from the changelog and include a link to the full changelog, e.g. `**Full Changelog:** https://github.com/bilby-dev/bilby/compare/...` 6. If this is latest stable release, make sure `Set at latest release` is checked. From 52345d79f2ebde35da66cba57c62fb7dda0e0a48 Mon Sep 17 00:00:00 2001 From: "Michael J. Williams" Date: Tue, 2 Sep 2025 16:51:12 +0100 Subject: [PATCH 3/4] DOC: fix typo Co-authored-by: Colm Talbot --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b27fe2d33..6f2a61c28 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -324,7 +324,7 @@ The version tag should also start with `v` e.g. `v2.4.0`. `bilby` uses `setuptools_scm` to automatically set the version based on git tags. This means no manual changes are needed to the version number are required. -As on version v2.6.0, `bilby` uses a [stable mainline](https://www.bitsnbites.eu/a-stable-mainline-branching-model-for-git/) branching model for releases. +As of version v2.6.0, `bilby` uses a [stable mainline](https://www.bitsnbites.eu/a-stable-mainline-branching-model-for-git/) branching model for releases. This means that all major and minor releases should have a corresponding branch `release/X.Y.x`. ### Updating the changelog From b0479afc8838f4d20f1300085d89b9ade19aa766 Mon Sep 17 00:00:00 2001 From: "Michael J. Williams" Date: Tue, 2 Sep 2025 17:13:39 +0100 Subject: [PATCH 4/4] DOC: update docs on making releases --- CONTRIBUTING.md | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6f2a61c28..d85e2176c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -340,12 +340,22 @@ When making a changelog keep the following in mind: - Include links to the relevant PRs - Remember to update the URLs at the bottom of changelog file -### Tagging a release +### Making the release branch #### Major and minor releases If making a major or minor release you must first make the release branch from the current `main` branch +##### Via the web interface + +From the [branches page of the repo](https://github.com/bilby-dev/bilby/branches), click `New branch`, +select `main` as the source and name the branch `release/Major.Minor.x` for example `release/2.6.x`. + +##### Via the command line + +Ensure you have checked out the `main` branch and it is up-to-date with the upstream repo. +Then run the following commands with the appropriate version number: + ```bash git checkout -b release/2.6.x git push upstream release/2.6.x @@ -360,7 +370,9 @@ into the release branch. **Note:** make sure the changelog is up-to-date. -#### Adding the tag +### Tagging the release (optional) + +**Note:** this step is optional but if followed, allows one to verify the correct commit has been tagged before making the release. Make sure you have the release branch checked out and up-to-date, then tag the release @@ -383,7 +395,9 @@ Once the changelog has been updated, follow these steps for making a release: 1. Navigate to https://github.com/bilby-dev/bilby/releases. 2. Click `Draft new release`. -3. Select an existing tag that does not have a release +3. Do **one of these steps**: + - **If you tagged the release manually**: click `Select Tag` and select the correct tag e.g. `v2.6.0` + - **If you did not tag the release manually**: click `Select Tag`, type the name of the tag e.g. `v2.6.0` and choose `Create new tag: on publish`. Set the `Target` to the release branch, e.g.`release/2.6.x` 4. Specify the version as the title, e.g. `v2.6.0`. 5. Copy the relevant section from the changelog and include a link to the full changelog, e.g. `**Full Changelog:** https://github.com/bilby-dev/bilby/compare/...`