Skip to content

Commit 76ecf1f

Browse files
authored
Merge pull request #353 from consideRatio/pr/refine-release-md-with-tbump
Refine RELEASE.md with tbump
2 parents 4ee815e + 468b590 commit 76ecf1f

File tree

2 files changed

+70
-61
lines changed

2 files changed

+70
-61
lines changed

RELEASE.md

Lines changed: 38 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,64 @@
11
# How to make a release
22

3-
`jupyter-server-proxy` is a package [available on
4-
PyPI](https://pypi.org/project/jupyter-server-proxy/) and
5-
[conda-forge](https://github.com/conda-forge/jupyter-server-proxy-feedstock).
6-
These are instructions on how to make a release on PyPI. The PyPI release is
7-
done automatically by [GitHub
8-
Actions](https://github.com/jupyterhub/jupyter-server-proxy/actions/workflows/publish.yaml)
9-
when a tag is pushed.
3+
`jupyter-server-proxy` is a package available on [PyPI][] and [conda-forge][].
4+
These are instructions on how to make a release.
105

11-
For you to follow along according to these instructions, you need:
6+
## Pre-requisites
127

13-
- To have push rights to the [jupyter-server-proxy GitHub
14-
repository](https://github.com/jupyterhub/jupyter-server-proxy).
8+
- Push rights to [github.com/jupyterhub/jupyter-server-proxy][]
9+
- Push rights to [conda-forge/jupyter-server-proxy-feedstock][]
1510

16-
## Steps to make before a release
11+
## Steps to make a release
1712

18-
1. Consider updating jupyterlab-server-proxy/yarl.lock to avoid a build
19-
environment with potential known vulnerabilities. At least check in at
20-
https://github.com/jupyterhub/jupyter-server-proxy/security/dependabot to
21-
make sure no known vulnerabilities are listed.
13+
1. Create a PR updating `jupyterlab-server-proxy/yarl.lock` and continue only
14+
when its merged.
2215

23-
If you want to update jupyterlab-server-proxy/yarl.lock, you can do so by
24-
deleting the file and doing the first step of the GitHub workflow we have
25-
defined to publish the PyPI package and the NPM package.
16+
This helps us avoid leaving known vulnerabilities are unfixed. To do this,
17+
delete the file and manually perform the the `build dist` step in the
18+
`.github/workflows/publish.yaml` workflow's `build` job as summarized below.
2619

2720
```shell
28-
pip install -U jupyter_packaging wheel "jupyterlab==3.*"
21+
rm jupyterlab-server-proxy/yarn.lock
22+
23+
pip install jupyter_packaging wheel jupyterlab~=3.0
2924
python setup.py sdist bdist_wheel
3025
```
3126

32-
2. Update [changelog.md](docs/source/changelog.md). Doing this can be made
33-
easier with the help of the
34-
[executablebooks/github-activity](https://github.com/executablebooks/github-activity)
35-
utility.
36-
37-
## Steps to make a release
27+
2. Create a PR updating `docs/source/changelog.md` with [github-activity][] and
28+
continue only when its merged.
3829

39-
1. Checkout `main` and make sure it is up to date.
30+
3. Checkout main and make sure it is up to date.
4031

4132
```shell
42-
ORIGIN=${ORIGIN:-origin} # set to the canonical remote, e.g. 'upstream' if 'origin' is not the official repo
4333
git checkout main
44-
git fetch $ORIGIN main
45-
git reset --hard $ORIGIN/main
46-
# WARNING! This next command deletes any untracked files in the repo
47-
git clean -xfd
34+
git fetch origin main
35+
git reset --hard origin/main
4836
```
4937

50-
1. Set the `version` variable in
51-
[jupyterlab-server-proxy/package.json](jupyterlab-server-proxy/package.json)
52-
appropriately and make a commit. Note that setup.py will read this from
53-
jupyterlab-server-proxy/package.json.
54-
55-
```
56-
git add jupyterlab-server-proxy/package.json
57-
VERSION=... # e.g. 1.2.3
58-
git commit -m "release v$VERSION"
59-
```
60-
61-
2. Push your commit to main.
38+
4. Update the version, make commits, and push a git tag with `tbump`.
6239

6340
```shell
64-
# first push commits without a tags to ensure the
65-
# commits comes through, because a tag can otherwise
66-
# be pushed all alone without company of rejected
67-
# commits, and we want have our tagged release coupled
68-
# with a specific commit in main
69-
git push $ORIGIN main
70-
```
41+
pip install tbump
42+
tbump --dry-run ${VERSION}
7143

72-
3. Create a git tag for the pushed release commit and push it.
44+
# run
45+
tbump ${VERSION}
46+
```
7347

74-
```shell
75-
git tag -a v$VERSION -m v$VERSION HEAD
48+
Following this, the [CI system][] will build and publish a release.
7649

77-
# then verify you tagged the right commit
78-
git log
50+
5. Reset the version back to dev, e.g. `4.0.1.dev0` after releasing `4.0.0`.
7951

80-
# then push it
81-
git push $ORIGIN refs/tags/v$VERSION
52+
```shell
53+
tbump --no-tag ${NEXT_VERSION}.dev0
8254
```
8355

84-
4. Following the release to PyPI, an automated PR should arrive to
85-
[conda-forge/jupyter-server-proxy-feedstock](https://github.com/conda-forge/oauthenticator-feedstock),
86-
check for the tests to succeed on this PR and then merge it to successfully
87-
update the package for `conda` on the conda-forge channel.
56+
6. Following the release to PyPI, an automated PR should arrive to
57+
[conda-forge/jupyter-server-proxy-feedstock][] with instructions.
58+
59+
[github-activity]: https://github.com/executablebooks/github-activity
60+
[github.com/jupyterhub/jupyter-server-proxy]: https://github.com/jupyterhub/jupyter-server-proxy
61+
[pypi]: https://pypi.org/project/jupyter-server-proxy/
62+
[conda-forge]: https://anaconda.org/conda-forge/repo2docker_service
63+
[conda-forge/jupyter-server-proxy-feedstock]: https://github.com/conda-forge/jupyter-server-proxy-feedstock
64+
[ci system]: https://github.com/jupyterhub/jupyter-server-proxy/actions/workflows/release.yaml

pyproject.toml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,35 @@
1+
# build-system
2+
# - ref 1: https://peps.python.org/pep-0517/
3+
#
14
[build-system]
25
requires = ["jupyter_packaging~=0.7.9", "jupyterlab~=3.0", "setuptools>=40.8.0", "wheel"]
36
build-backend = "setuptools.build_meta"
7+
8+
9+
# tbump is used to simplify and standardize the release process when updating
10+
# the version, making a git commit and tag, and pushing changes.
11+
#
12+
# ref: https://github.com/your-tools/tbump#readme
13+
#
14+
[tool.tbump]
15+
github_url = "https://github.com/jupyterhub/jupyter-server-proxy"
16+
17+
[tool.tbump.version]
18+
current = "3.2.2"
19+
regex = '''
20+
(?P<major>\d+)
21+
\.
22+
(?P<minor>\d+)
23+
\.
24+
(?P<patch>\d+)
25+
(?P<pre>((a|b|rc)\d+)|)
26+
\.?
27+
(?P<dev>(?<=\.)dev\d*|)
28+
'''
29+
30+
[tool.tbump.git]
31+
message_template = "Bump to {new_version}"
32+
tag_template = "v{new_version}"
33+
34+
[[tool.tbump.file]]
35+
src = "jupyterlab-server-proxy/package.json"

0 commit comments

Comments
 (0)