-
Notifications
You must be signed in to change notification settings - Fork 88
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
Add and document release automation via github actions #155
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# dependabot.yaml reference: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file | ||
# | ||
# Notes: | ||
# - Status and logs from dependabot are provided at | ||
# https://github.com/jupyterhub/jupyterhub-python-repo-template/network/updates. | ||
# | ||
version: 2 | ||
updates: | ||
# Maintain dependencies in our GitHub Workflows | ||
- package-ecosystem: github-actions | ||
directory: / | ||
labels: [ci] | ||
schedule: | ||
interval: monthly | ||
time: "05:00" | ||
timezone: Etc/UTC |
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 |
---|---|---|
@@ -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: | ||
- "**.md" | ||
- ".github/workflows/*.yaml" | ||
- "!.github/workflows/release.yaml" | ||
push: | ||
paths-ignore: | ||
- "**.md" | ||
- ".github/workflows/*.yaml" | ||
- "!.github/workflows/release.yaml" | ||
branches-ignore: | ||
- "dependabot/**" | ||
- "pre-commit-ci-update-config" | ||
tags: ["**"] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-release: | ||
runs-on: ubuntu-24.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@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
|
||
- 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/') |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# How to make a release | ||
|
||
`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 GitHub repository | ||
|
||
## Steps to make a release | ||
|
||
1. Create a PR updating `CHANGELOG.md` with [github-activity] and continue when | ||
its merged. For details about this, see the [team-compass documentation] | ||
about it. | ||
|
||
[team-compass documentation]: https://jupyterhub-team-compass.readthedocs.io/en/latest/practices/releases.html | ||
|
||
2. Checkout main and make sure it is up to date. | ||
|
||
```shell | ||
git checkout main | ||
git fetch origin main | ||
git reset --hard origin/main | ||
``` | ||
|
||
3. Update the version, make commits, and push a git tag with `tbump`. | ||
|
||
```shell | ||
pip install tbump | ||
``` | ||
|
||
`tbump` will ask for confirmation before doing anything. | ||
|
||
```shell | ||
# Example versions to set: 1.0.0, 1.0.0b1 | ||
VERSION= | ||
tbump ${VERSION} | ||
``` | ||
|
||
Following this, the [CI system] will build and publish a release. | ||
|
||
4. Reset the version back to dev, e.g. `1.0.1.dev` after releasing `1.0.0`. | ||
|
||
```shell | ||
# Example version to set: 1.0.1.dev | ||
NEXT_VERSION= | ||
tbump --no-tag ${NEXT_VERSION}.dev | ||
``` | ||
|
||
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 | ||
[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 |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# tbump is used to simplify and standardize the release process when updating | ||
# the version, making a git commit and tag, and pushing changes. | ||
# | ||
# ref: https://github.com/your-tools/tbump#readme | ||
# | ||
[tool.tbump] | ||
github_url = "https://github.com/jupyterhub/jupyter-rsession-proxy" | ||
|
||
[tool.tbump.version] | ||
current = "2.2.1" | ||
regex = ''' | ||
(?P<major>\d+) | ||
\. | ||
(?P<minor>\d+) | ||
\. | ||
(?P<patch>\d+) | ||
(?P<pre>((a|b|rc)\d+)|) | ||
\.? | ||
(?P<dev>(?<=\.)dev\d*|) | ||
''' | ||
|
||
[tool.tbump.git] | ||
message_template = "Bump to v{new_version}" | ||
tag_template = "v{new_version}" | ||
|
||
[[tool.tbump.file]] | ||
src = "setup.py" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ryanlovett @yuvipanda @minrk could one of you provide this github workflow with the permissions to publish to PyPI?
You'd visit https://pypi.org/manage/project/jupyter-rsession-proxy/settings/publishing/ and under "Add a new publisher" populate 3/4 fields like:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@consideRatio Done!