Skip to content

Commit 16508fc

Browse files
mj-willColmTalbot
andauthored
BLD: use release branches (#954)
* BLD: use release branch semver * DOC: update `making releases` to describe process using release branches * DOC: fix typo Co-authored-by: Colm Talbot <talbotcolm@gmail.com> * DOC: update docs on making releases --------- Co-authored-by: Colm Talbot <talbotcolm@gmail.com>
1 parent 72f90f2 commit 16508fc

2 files changed

Lines changed: 54 additions & 3 deletions

File tree

CONTRIBUTING.md

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,9 @@ The version tag should also start with `v` e.g. `v2.4.0`.
324324
`bilby` uses `setuptools_scm` to automatically set the version based on git tags.
325325
This means no manual changes are needed to the version number are required.
326326

327+
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.
328+
This means that all major and minor releases should have a corresponding branch `release/X.Y.x`.
329+
327330
### Updating the changelog
328331

329332
Before making a release, the [changelog](https://github.com/bilby-dev/bilby/blob/main/CHANGELOG.md)
@@ -337,6 +340,52 @@ When making a changelog keep the following in mind:
337340
- Include links to the relevant PRs
338341
- Remember to update the URLs at the bottom of changelog file
339342

343+
### Making the release branch
344+
345+
#### Major and minor releases
346+
347+
If making a major or minor release you must first make the release branch from the current `main` branch
348+
349+
##### Via the web interface
350+
351+
From the [branches page of the repo](https://github.com/bilby-dev/bilby/branches), click `New branch`,
352+
select `main` as the source and name the branch `release/Major.Minor.x` for example `release/2.6.x`.
353+
354+
##### Via the command line
355+
356+
Ensure you have checked out the `main` branch and it is up-to-date with the upstream repo.
357+
Then run the following commands with the appropriate version number:
358+
359+
```bash
360+
git checkout -b release/2.6.x
361+
git push upstream release/2.6.x
362+
```
363+
364+
**Note:** this assume you have add the `bilby-dev/bilby` repository as `upstream`
365+
366+
#### Bug-fix releases
367+
368+
If making a bugfix release, the relevant commits should be cherry-picked and merged
369+
into the release branch.
370+
371+
**Note:** make sure the changelog is up-to-date.
372+
373+
### Tagging the release (optional)
374+
375+
**Note:** this step is optional but if followed, allows one to verify the correct commit has been tagged before making the release.
376+
377+
Make sure you have the release branch checked out and up-to-date, then tag the release
378+
379+
```bash
380+
git tag v2.6.0
381+
```
382+
383+
Once it is tagged, it should be pushed to the `bilby-dev/bilby` repository.
384+
385+
```bash
386+
git push upstream v2.6.0
387+
```
388+
340389
### Making the release on GitHub
341390

342391
**Note:** releases will automatically be pushed to PyPI and versions on PyPI
@@ -346,9 +395,10 @@ Once the changelog has been updated, follow these steps for making a release:
346395

347396
1. Navigate to https://github.com/bilby-dev/bilby/releases.
348397
2. Click `Draft new release`.
349-
3. Select an existing tag that does not have a release or specify the name of a
350-
new tag that will be made when the release is made.
351-
4. Specify the version as the title, e.g. `v2.4.0`.
398+
3. Do **one of these steps**:
399+
- **If you tagged the release manually**: click `Select Tag` and select the correct tag e.g. `v2.6.0`
400+
- **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: <tag name> on publish`. Set the `Target` to the release branch, e.g.`release/2.6.x`
401+
4. Specify the version as the title, e.g. `v2.6.0`.
352402
5. Copy the relevant section from the changelog and include a link to the full changelog, e.g.
353403
`**Full Changelog:** https://github.com/bilby-dev/bilby/compare/<previous-release>...<this-release>`
354404
6. If this is latest stable release, make sure `Set at latest release` is checked.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,4 +146,5 @@ mcmc = {file = ["mcmc_requirements.txt"]}
146146
"bilby.gw.eos" = ["eos_tables/*.dat"]
147147

148148
[tool.setuptools_scm]
149+
"version_scheme" = "release-branch-semver"
149150
write_to = "bilby/_version.py"

0 commit comments

Comments
 (0)