|
| 1 | +# Release process |
| 2 | + |
| 3 | +This section documents the steps to make a release of docstub. |
| 4 | +Depending on the release type not all steps may be mandatory – use appropriate judgement. |
| 5 | + |
| 6 | + |
| 7 | +## Create release notes |
| 8 | + |
| 9 | +Generate a [read-only GitHub token](https://github.com/settings/personal-access-tokens), install [changelist](https://github.com/scientific-python/changelist), and generate a first draft of the release notes with it. |
| 10 | + |
| 11 | +```shell |
| 12 | +pip install changelist |
| 13 | + |
| 14 | +RELEASE_TAG=... |
| 15 | +PREV_TAG=... |
| 16 | +export GH_TOKEN=... |
| 17 | + |
| 18 | +changelist scientific-python/docstub \ |
| 19 | + --version "${RELEASE_TAG}" \ |
| 20 | + --out "doc/release_notes/v${RELEASE_TAG}.md" \ |
| 21 | + "${PREV_TAG}" main |
| 22 | +``` |
| 23 | + |
| 24 | +- `RELEASE_TAG` is the tag of the current release (for example `v1.1.0`) |
| 25 | +- `PREV_TAG` is the tag of the previous release (for example `v1.0.0`). |
| 26 | + |
| 27 | +So changelist will generate notes based on the changes between `${PREV_TAG}..main`. |
| 28 | + |
| 29 | +Review and update `doc/release_notes/v${RELEASE_TAG}.md`. |
| 30 | +Don't forget to add the new document to `doc/release_notes/index.md`. |
| 31 | + |
| 32 | +Create a pull request with the new release notes. |
| 33 | +If desired, include this pull request in the release notes, too. |
| 34 | + |
| 35 | + |
| 36 | +## Create a new tag |
| 37 | + |
| 38 | +Once the pull request with the release notes is merged, tag the resulting commit with the desired version tag. |
| 39 | +This should be a signed tag. |
| 40 | + |
| 41 | +```shell |
| 42 | +git tag --sign "v${RELEASE_TAG}" |
| 43 | +``` |
| 44 | + |
| 45 | +Include the release notes in the tag's message in the same formatting style as other release tags. |
| 46 | + |
| 47 | +Review and then push the tag: |
| 48 | + |
| 49 | +```shell |
| 50 | +git push origin "v${RELEASE_TAG}" |
| 51 | +``` |
| 52 | + |
| 53 | + |
| 54 | +## Create a new "version" on Read the Docs |
| 55 | + |
| 56 | +Login to https://app.readthedocs.org/projects/docstub. |
| 57 | + |
| 58 | +Create a [new version](https://app.readthedocs.org/dashboard/docstub/version/create/) for the tag corresponding to the new release. |
| 59 | + |
| 60 | + |
| 61 | +## Trigger release workflow on GitHub |
| 62 | + |
| 63 | +Trigger [docstub's release workflow on GitHub](https://github.com/scientific-python/docstub/actions/workflows/cd.yml). |
| 64 | +As a security measure, this workflow needs to be approved by one eligible maintainer. |
| 65 | +If successful, the workflow will build the package and push it to PyPI. |
| 66 | + |
| 67 | + |
| 68 | +## Format and publish GitHub release |
| 69 | + |
| 70 | +[Create a new release draft](https://github.com/scientific-python/docstub/releases/new) and copy the content of `doc/release_notes/v${RELEASE_TAG}.md` into it. |
| 71 | +(Remove the duplicate level 1 headline in the first line.) |
| 72 | + |
| 73 | +Review and publish. |
0 commit comments