Skip to content

Commit 1ee85c8

Browse files
author
alrex
authored
infra: removing workflow, updating script (#734)
More work to improve release process: - adding RELEASING.md file to describe release process - updated prepare_release.sh script to allow it to be run manually by maintainers - removed workflow to automatically publish PR, current recommendation from otel technical committee is not to use bot accounts
1 parent 027f61f commit 1ee85c8

File tree

3 files changed

+94
-33
lines changed

3 files changed

+94
-33
lines changed

.github/workflows/prepare-release.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

RELEASING.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
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!

scripts/prepare_release.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/bin/bash -x
22
#
33
# This script:
44
# 1. parses the version number from the branch name
@@ -72,10 +72,17 @@ function update_changelog() {
7272
fi
7373
}
7474

75+
# create the release branch
76+
git checkout master
77+
git reset --hard origin/master
78+
git checkout -b release/${VERSION}
79+
git push origin release/${VERSION}
80+
81+
# create a temporary branch to create a PR for updated version and changelogs
82+
git checkout -b release/${VERSION}-auto
7583
update_version_file
7684
update_changelog
77-
78-
git config --local user.email "[email protected]"
79-
git config --local user.name "GitHub Action"
8085
git commit -m "updating changelogs and version to ${VERSION}"
81-
echo "::set-output name=version_updated::1"
86+
87+
echo "Time to create a release, here's a sample title:"
88+
echo "[pre-release] Update changelogs, version [${VERSION}]"

0 commit comments

Comments
 (0)