|
| 1 | +# Releasing OpenTelemetry Packages (for maintainers only) |
| 2 | +This document explains how to publish all OT modules at version x.y.z. Ensure that you’re following semver when choosing a version number. |
| 3 | + |
| 4 | +Release Process: |
| 5 | +* [Create a new branch](#create-a-new-branch) |
| 6 | +* [Open a Pull Request](#open-a-pull-request) |
| 7 | +* [Create a Release](#Create-a-Release) |
| 8 | +* [Move stable tag](#Move-stable-tag) |
| 9 | +* [Update master](#Update-master) |
| 10 | +* [Check PyPI](#Check-PyPI) |
| 11 | +* [Troubleshooting](#troubleshooting) |
| 12 | + |
| 13 | + |
| 14 | +## Create a new branch |
| 15 | +The following script does the following: |
| 16 | +- update master locally |
| 17 | +- creates a new release branch `release/<version>` |
| 18 | +- updates version and changelog files |
| 19 | +- commits the change to a new branch `release/<version>-auto` |
| 20 | + |
| 21 | +*NOTE: This script was run by a GitHub Action but required the Action bot to be excluded from the CLA check, which it currently is not.* |
| 22 | + |
| 23 | +```bash |
| 24 | +./scripts/prepare_release.sh 0.7b0 |
| 25 | +``` |
| 26 | + |
| 27 | +## Open a Pull Request |
| 28 | + |
| 29 | +The PR should be opened from the `release/<version>-auto` branch created as part of running `prepare_release.sh` in the steps above. |
| 30 | + |
| 31 | +## Create a Release |
| 32 | + |
| 33 | +- Create the GH release from the release branch, using a new tag for this micro version, e.g. `v0.7.0` |
| 34 | +- Copy the changelogs from all packages that changed into the release notes (and reformat to remove hard line wraps) |
| 35 | + |
| 36 | + |
| 37 | +## Check PyPI |
| 38 | + |
| 39 | +This should be handled automatically on release by the [publish action](https://github.com/open-telemetry/opentelemetry-python/blob/master/.github/workflows/publish.yml). |
| 40 | + |
| 41 | + - Check the [action logs](https://github.com/open-telemetry/opentelemetry-python/actions?query=workflow%3APublish) to make sure packages have been uploaded to PyPI |
| 42 | +- Check the release history (e.g. https://pypi.org/project/opentelemetry-api/#history) on PyPI |
| 43 | + |
| 44 | +If for some reason the action failed, see [Publish failed](#publish-failed) below |
| 45 | + |
| 46 | +## Move stable tag |
| 47 | + |
| 48 | +This will ensure the docs are pointing at the stable release. |
| 49 | + |
| 50 | +```bash |
| 51 | +git tag -d stable |
| 52 | +git tag stable |
| 53 | +git push origin stable |
| 54 | +``` |
| 55 | + |
| 56 | +## Update master |
| 57 | + |
| 58 | +Ensure the version and changelog updates have been applied to master. |
| 59 | + |
| 60 | +```bash |
| 61 | +# checkout a new branch from master |
| 62 | +git checkout -b v0.7b0-master-update |
| 63 | +# cherry pick the change from the release branch |
| 64 | +git cherry-pick $(git log -n 1 origin/release/0.7b0 --format="%H") |
| 65 | +# update the version number, make it a "dev" greater than release number, e.g. 0.8.dev0 |
| 66 | +perl -i -p -e 's/0.7b0/0.8.dev0/' $(git grep -l "0.7b0" | grep -vi CHANGELOG) |
| 67 | +# open a PR targeting master see #331 |
| 68 | +git commit -m |
| 69 | +``` |
| 70 | + |
| 71 | +## Troubleshooting |
| 72 | + |
| 73 | +### Publish failed |
| 74 | + |
| 75 | +If for some reason the action failed, do it manually: |
| 76 | + |
| 77 | +- To avoid pushing untracked changes, check out the repo in a new dir |
| 78 | +- Switch to the release branch (important so we don't publish packages with "dev" versions) |
| 79 | +- Build distributions with `./scripts/build.sh` |
| 80 | +- Delete distributions we don't want to push (e.g. `testutil`) |
| 81 | +- Push to PyPI as `twine upload --skip-existing --verbose dist/*` |
| 82 | +- Double check PyPI! |
0 commit comments