|
1 | 1 | # How to make a release
|
2 | 2 |
|
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. |
10 | 5 |
|
11 |
| -For you to follow along according to these instructions, you need: |
| 6 | +## Pre-requisites |
12 | 7 |
|
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][] |
15 | 10 |
|
16 |
| -## Steps to make before a release |
| 11 | +## Steps to make a release |
17 | 12 |
|
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. |
22 | 15 |
|
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. |
26 | 19 |
|
27 | 20 | ```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 |
29 | 24 | python setup.py sdist bdist_wheel
|
30 | 25 | ```
|
31 | 26 |
|
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. |
38 | 29 |
|
39 |
| -1. Checkout `main` and make sure it is up to date. |
| 30 | +3. Checkout main and make sure it is up to date. |
40 | 31 |
|
41 | 32 | ```shell
|
42 |
| - ORIGIN=${ORIGIN:-origin} # set to the canonical remote, e.g. 'upstream' if 'origin' is not the official repo |
43 | 33 | 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 |
48 | 36 | ```
|
49 | 37 |
|
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`. |
62 | 39 |
|
63 | 40 | ```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} |
71 | 43 |
|
72 |
| -3. Create a git tag for the pushed release commit and push it. |
| 44 | + # run |
| 45 | + tbump ${VERSION} |
| 46 | + ``` |
73 | 47 |
|
74 |
| - ```shell |
75 |
| - git tag -a v$VERSION -m v$VERSION HEAD |
| 48 | + Following this, the [CI system][] will build and publish a release. |
76 | 49 |
|
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`. |
79 | 51 |
|
80 |
| - # then push it |
81 |
| - git push $ORIGIN refs/tags/v$VERSION |
| 52 | + ```shell |
| 53 | + tbump --no-tag ${NEXT_VERSION}.dev0 |
82 | 54 | ```
|
83 | 55 |
|
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 |
0 commit comments