Skip to content

Commit

Permalink
Add github actions based release automation
Browse files Browse the repository at this point in the history
  • Loading branch information
consideRatio committed Oct 21, 2024
1 parent b947d24 commit 7d88195
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 0 deletions.
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:
- "**.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/')
Empty file added RELEASE.md
Empty file.
27 changes: 27 additions & 0 deletions pyproject.toml
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"

0 comments on commit 7d88195

Please sign in to comment.