|
1 | 1 | # Release process |
2 | 2 |
|
3 | | -* Ensure you have a backup of all working files and then remove files not tracked by git |
4 | | - `git clean -xdf`. **NOTE**: this will delete all files in the tuf tree that aren't |
5 | | - tracked by git |
6 | | -* Ensure `docs/CHANGELOG.md` contains a one-line summary of each [notable |
| 3 | + |
| 4 | +**Prerequisites (one-time setup)** |
| 5 | + |
| 6 | + |
| 7 | +1. Go to [PyPI management page](https://pypi.org/manage/account/#api-tokens) and create |
| 8 | + an [API token](https://pypi.org/help/#apitoken) with its scope limited to the tuf project. |
| 9 | +1. Go to [GitHub |
| 10 | + settings](https://github.com/theupdateframework/python-tuf/settings/environments), |
| 11 | + create an |
| 12 | + [environment](https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#creating-an-environment) |
| 13 | + called `release` and configure [review |
| 14 | + protection](https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#required-reviewers). |
| 15 | +1. In the environment create a |
| 16 | + [secret](https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#environment-secrets) |
| 17 | + called `PYPI_API_TOKEN` and paste the token created above. |
| 18 | + |
| 19 | +## Release |
| 20 | + |
| 21 | +1. Ensure `docs/CHANGELOG.md` contains a one-line summary of each [notable |
7 | 22 | change](https://keepachangelog.com/) since the prior release |
8 | | -* Update `tuf/__init__.py` to the new version number "A.B.C" |
9 | | -* Test packaging, uploading to Test PyPI and installing from a virtual environment |
10 | | - (ensure commands invoking `python` below are using Python 3) |
11 | | - * Remove existing dist build dirs |
12 | | - * Create source dist and wheel `python3 -m build` |
13 | | - * Sign source dist `gpg --detach-sign -a dist/tuf-A.B.C.tar.gz` |
14 | | - * Sign wheel `gpg --detach-sign -a dist/tuf-A.B.C-py3-none-any.whl` |
15 | | - * Upload to test PyPI `twine upload --repository testpypi dist/*` |
16 | | - * Verify the uploaded package at https://test.pypi.org/project/tuf/: |
17 | | - Note that installing packages with pip using test.pypi.org is potentially |
18 | | - dangerous (as dependencies may be squatted): download the file and install |
19 | | - the local file instead. |
20 | | -* Create a PR with updated `CHANGELOG.md` and version bumps |
21 | | -* Once the PR is merged, pull the updated `develop` branch locally |
22 | | -* Create a signed tag matching the updated version number on the merge commit |
| 23 | +2. Update `tuf/__init__.py` to the new version number `A.B.C` |
| 24 | +3. Create a PR with updated `CHANGELOG.md` and version bumps |
| 25 | + |
| 26 | +➔ Review PR on GitHub |
| 27 | + |
| 28 | +4. Once the PR is merged, pull the updated `develop` branch locally |
| 29 | +5. Create a signed tag for the version number on the merge commit |
23 | 30 | `git tag --sign vA.B.C -m "vA.B.C"` |
24 | | - * Push the tag to GitHub `git push origin vA.B.C` |
25 | | -* Create a new release on GitHub, copying the `CHANGELOG.md` entries for the |
26 | | - release |
27 | | -* Create a package for the formal release |
28 | | - (ensure commands invoking `python` below are using Python 3) |
29 | | - * Remove existing dist build dirs |
30 | | - * Create source dist and wheel `python3 -m build` |
31 | | - * Sign source dist `gpg --detach-sign -a dist/tuf-A.B.C.tar.gz` |
32 | | - * Sign wheel `gpg --detach-sign -a dist/tuf-A.B.C-py3-none-any.whl` |
33 | | - * Upload to PyPI `twine upload dist/*` |
34 | | - * Verify the package at https://pypi.org/project/tuf/ and by installing with pip |
35 | | -* Attach both signed dists and their detached signatures to the release on GitHub |
36 | | -* `verify_release` should be used to make sure the release artifacts match the |
37 | | - git sources, preferably by another developer on a different machine. |
38 | | -* Announce the release on [#tuf on CNCF Slack](https://cloud-native.slack.com/archives/C8NMD3QJ3) |
39 | | -* Ensure [POUF 1](https://github.com/theupdateframework/taps/blob/master/POUFs/reference-POUF/pouf1.md), for the reference implementation, is up-to-date |
| 31 | +6. Push the tag to GitHub `git push origin vA.B.C` |
| 32 | + |
| 33 | + *A push triggers the [CI workflow](.github/workfows/ci.yml), which, on success, |
| 34 | + triggers the [CD workflow](.github/workfows/cd.yml), which builds source dist and |
| 35 | + wheel, creates a preliminary GitHub release under `vA.B.C-rc`, and pauses for review.* |
| 36 | + |
| 37 | +7. Run `verify_release --skip-pypi` locally to make sure a build on your machine matches |
| 38 | + the preliminary release artifacts published on GitHub. |
| 39 | + |
| 40 | +➔ [Review *deployment*](https://docs.github.com/en/actions/managing-workflow-runs/reviewing-deployments) |
| 41 | +on GitHub |
| 42 | + |
| 43 | + *An approval resumes the CD workflow to publish the release on PyPI, and to finalize the |
| 44 | + GitHub release (removes `-rc` suffix and updates release notes).* |
| 45 | + |
| 46 | +8. `verify_release` may be used again to make sure the PyPI release artifacts match the |
| 47 | + local build as well. |
| 48 | +9. Announce the release on [#tuf on CNCF Slack](https://cloud-native.slack.com/archives/C8NMD3QJ3) |
| 49 | +10. Ensure [POUF 1](https://github.com/theupdateframework/taps/blob/master/POUFs/reference-POUF/pouf1.md), |
| 50 | + for the reference implementation, is up-to-date |
0 commit comments