forked from jupyterhub/nbgitpuller
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Align with org wide pattern on making releases (tbump, pypi credentials)
- Loading branch information
1 parent
9efc02e
commit 5c1bba5
Showing
6 changed files
with
91 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,60 @@ | ||
# How to make a release | ||
|
||
`nbgitpuller` is a package available on | ||
[PyPI](https://pypi.org/project/nbgitpuller/) and | ||
[conda-forge](https://anaconda.org/conda-forge/nbgitpuller). | ||
These are instructions on how to make a release on PyPI. | ||
The PyPI release is done automatically by TravisCI when a tag is pushed. | ||
`nbgitpuller` is a package available on [PyPI] and [conda-forge]. | ||
|
||
These are the instructions on how to make a release. | ||
|
||
## Pre-requisites | ||
|
||
- Push rights to this GitHub repository | ||
|
||
## Steps to make a release | ||
|
||
1. Checkout main and make sure it is up to date. | ||
1. Create a PR updating `CHANGELOG.md` with [github-activity] and continue when | ||
its merged. | ||
|
||
```shell | ||
ORIGIN=${ORIGIN:-origin} # set to the canonical remote, e.g. 'upstream' if 'origin' is not the official repo | ||
git checkout main | ||
git fetch $ORIGIN main | ||
git reset --hard $ORIGIN/main | ||
# WARNING! This next command deletes any untracked files in the repo | ||
git clean -xfd | ||
``` | ||
Advice on this procedure can be found in [this team compass | ||
issue](https://github.com/jupyterhub/team-compass/issues/563). | ||
|
||
1. Set the `__version__` variable in | ||
[`nbgitpuller/version.py`](nbgitpuller/version.py) | ||
and make a commit. | ||
2. Checkout main and make sure it is up to date. | ||
|
||
```shell | ||
git add nbgitpuller/version.py | ||
VERSION=... # e.g. 1.2.3 | ||
git commit -m "release $VERSION" | ||
git checkout main | ||
git fetch origin main | ||
git reset --hard origin/main | ||
``` | ||
|
||
1. Reset the `__version__` variable in | ||
[`nbgitpuller/version.py`](nbgitpuller/version.py) | ||
to an incremented patch version with a `dev` element, then make a commit. | ||
3. Update the version, make commits, and push a git tag with `tbump`. | ||
|
||
```shell | ||
git add nbgitpuller/version.py | ||
git commit -m "back to dev" | ||
pip install tbump | ||
``` | ||
|
||
1. Push your two commits to main. | ||
`tbump` will ask for confirmation before doing anything. | ||
|
||
```shell | ||
# first push commits without a tags to ensure the | ||
# commits comes through, because a tag can otherwise | ||
# be pushed all alone without company of rejected | ||
# commits, and we want have our tagged release coupled | ||
# with a specific commit in main | ||
git push $ORIGIN main | ||
# Example versions to set: 1.0.0, 1.0.0b1 | ||
VERSION= | ||
tbump ${VERSION} | ||
``` | ||
|
||
1. Create a git tag for the pushed release commit and push it. | ||
|
||
```shell | ||
git tag -a $VERSION -m $VERSION HEAD~1 | ||
Following this, the [CI system] will build and publish a release. | ||
|
||
# then verify you tagged the right commit | ||
git log | ||
4. Reset the version back to dev, e.g. `1.0.1.dev` after releasing `1.0.0`. | ||
|
||
# then push it | ||
git push $ORIGIN refs/tags/$VERSION | ||
```shell | ||
# Example version to set: 1.0.1.dev | ||
NEXT_VERSION= | ||
tbump --no-tag ${NEXT_VERSION}.dev | ||
``` | ||
|
||
1. Following the release to PyPI, an automated PR should arrive to | ||
[conda-forge/nbgitpuller-feedstock](https://github.com/conda-forge/nbgitpuller-feedstock), | ||
check for the tests to succeed on this PR and then merge it to successfully | ||
update the package for `conda` on the `conda-forge` channel. | ||
5. Following the release to PyPI, an automated PR should arrive within 24 hours | ||
to [conda-forge/nbgitpuller-feedstock] with instructions | ||
on releasing to conda-forge. You are welcome to volunteer doing this, but | ||
aren't required as part of making this release to PyPI. | ||
|
||
[github-activity]: https://github.com/executablebooks/github-activity | ||
[pypi]: https://pypi.org/project/nbgitpuller/ | ||
[conda-forge]: https://anaconda.org/conda-forge/nbgitpuller | ||
[conda-forge/nbgitpuller-feedstock]: https://github.com/conda-forge/nbgitpuller-feedstock | ||
[ci system]: https://github.com/jupyterhub/nbgitpuller/actions/workflows/release.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
""""The nbgitpuller PyPI package SemVer version.""" | ||
__version__ = '1.1.2dev' | ||
# __version__ should be updated using tbump, based on configuration in | ||
# pyproject.toml, according to instructions in RELEASE.md. | ||
# | ||
__version__ = "1.1.2.dev" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters