Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update RELEASE.md and add release.yaml workflow #17

Merged
merged 3 commits into from
Apr 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# This is a GitHub workflow defining a set of jobs with a set of steps.
# ref: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
#
name: Release

# Always tests wheel building, but only publish to PyPI on pushed tags.
on:
pull_request:
paths-ignore:
- "docs/**"
- ".github/workflows/*.yaml"
- "!.github/workflows/release.yaml"
push:
paths-ignore:
- "docs/**"
- ".github/workflows/*.yaml"
- "!.github/workflows/release.yaml"
branches-ignore:
- "dependabot/**"
- "pre-commit-ci-update-config"
tags: ["**"]
workflow_dispatch:

jobs:
build-release:
runs-on: ubuntu-22.04
permissions:
# id-token=write is required for pypa/gh-action-pypi-publish, and the PyPI
# project needs to be configured to trust this workflow.
#
# ref: https://github.com/jupyterhub/team-compass/issues/648
#
id-token: write

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: install build package
run: |
pip install --upgrade pip
pip install build
pip freeze

- name: build release
run: |
python -m build --sdist --wheel .
ls -l dist

- name: publish to pypi
uses: pypa/gh-action-pypi-publish@release/v1
if: startsWith(github.ref, 'refs/tags/')
45 changes: 23 additions & 22 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@

# How to make a release

`jupyterhub-python-repo-template` is a package available on [PyPI][].
`jupyterhub-python-repo-template` 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 repo
- Push rights to this GitHub repository

## Steps to make a release

1. Create a PR updating `docs/source/changelog.md` with [github-activity][] and
1. Create a PR updating `docs/source/changelog.md` with [github-activity] and
continue to step 2 **only when its merged.**

Tips about getting the most out of github-activity (from https://github.com/jupyterhub/team-compass/issues/563):
Expand Down Expand Up @@ -46,45 +47,45 @@ These are the instructions on how to make a release.
- [ ] Make a commit with a message similar to _"Add changelog for 1.2.3"_ and open a PR titled the same
- [ ] Await merge, then move on to step 2 described below

1. Checkout main and make sure it is up to date.
2. Checkout main and make sure it is up to date.

```shell
git checkout main
git fetch origin main
git reset --hard origin/main
```

1. Export the version into an environment variable for easier usage.
Example:
3. Update the version, make commits, and push a git tag with `tbump`.

```shell
export VERSION=0.0.1
pip install tbump
```

1. Update the version, make commits, and push a git tag with `tbump`.
`tbump` will ask for confirmation before doing anything.

```shell
pip install tbump
tbump --dry-run ${VERSION}

# run
# Example versions to set: 1.0.0, 1.0.0b1
VERSION=
tbump ${VERSION}
```

Following this, the [CI system][] will build and publish a release.
Following this, the [CI system] will build and publish a release.

1. Reset the version back to dev, e.g. `2.0.1.dev0` after releasing `2.0.0`.
4. Reset the version back to dev, e.g. `1.0.1.dev` after releasing `1.0.0`.

```shell
tbump --no-tag ${NEXT_VERSION}.dev0
# 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/jupyterhub-kubespawner-feedstock][] with instructions.
5. Following the release to PyPI, an automated PR should arrive within 24 hours
to [conda-forge/jupyterhub-python-repo-template-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
[github.com/jupyterhub/kubespawner]: https://github.com/jupyterhub/kubespawner
[pypi]: https://pypi.org/project/jupyterhub-kubespawner/
[conda-forge]: https://anaconda.org/conda-forge/jupyterhub-kubespawner
[conda-forge/jupyterhub-kubespawner-feedstock]: https://github.com/conda-forge/jupyterhub-kubespawner-feedstock
[ci system]: https://github.com/jupyterhub/kubespawner/actions/workflows/publish.yaml
[pypi]: https://pypi.org/project/jupyterhub-python-repo-template/
[conda-forge]: https://anaconda.org/conda-forge/jupyterhub-python-repo-template
[conda-forge/jupyterhub-python-repo-template-feedstock]: https://github.com/conda-forge/jupyterhub-python-repo-template-feedstock
[ci system]: https://github.com/jupyterhub/jupyterhub-python-repo-template/actions/workflows/release.yaml