Repository navigation
Add automated PyPI releases and CalVer release drafting workflows - #461
Open
Moustachauve wants to merge 1 commit into
Open
Moustachauve wants to merge 1 commit into
Moustachauve wants to merge 1 commit into
Conversation
Moustachauve
marked this pull request as ready for review
October 8, 2026 03:42
Automated package publishing to PyPI was missing from python-hilo, requiring manual intervention for releases. In addition, Release Drafter previously lacked CalVer version calculation, which prevented automated tag and release note drafting under the YYYY.M.patch scheme used across the project history. Following the release architecture established in python-hotspring and dvd-dev/hilo#1066: - Introduces scripts/release.py to calculate the next CalVer version and stamp version changes across pyproject.toml and pyhilo/const.py, backed by unit tests in tests/test_release.py. - Configures .github/workflows/release-drafter.yml to automatically calculate and apply the next CalVer version tag to GitHub release drafts on merge to main. - Adds .github/workflows/release.yaml to build distribution packages and publish them to PyPI via Trusted Publishing (OIDC) when a GitHub release is published. Maintainers must configure PyPI Trusted Publishing for the repository under the 'release' environment before the publishing workflow can upload packages.
Moustachauve
force-pushed
the
ci/pypi-automatic-release
branch
from
October 8, 2026 03:42
2e1dd0a to
6a3f844
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Automate PyPI package publishing and CalVer draft release generation.
Context & Rationale
Releases currently require manual packaging and distribution steps to publish to PyPI. In addition, Release Drafter did not automatically calculate upcoming release tags under
python-hilo's calendar versioning scheme (YYYY.M.patch), requiring manual versioning coordination acrosspyproject.tomlandpyhilo/const.py.Following the release architecture established in
python-hotspringanddvd-dev/hilo#1066, this PR introduces:scripts/release.pyto calculate the next CalVer version (--next-version) and stamp version changes acrosspyproject.tomlandpyhilo/const.py(--set-version <TAG>).tests/test_release.pycovering tag parsing, month resets, patch increments, and version stamping..github/workflows/release-drafter.ymlon merges tomain..github/workflows/release.yamlvia GitHub OpenID Connect (OIDC / Trusted Publishing) upon release publication.Required Setup Before Merging
Before this workflow can publish releases, the repository owner needs to configure PyPI Trusted Publishing and GitHub environments:
dvd-devpython-hilorelease.yamlreleaserelease(optional deployment protection rules or reviewers can be configured here).New Release Workflow
After this PR is merged:
mainas normal. TheDraft a release noteworkflow automatically updates a GitHub release draft with compiled release notes and the next CalVer tag (e.g.,v2026.10.1)..github/workflows/release.yaml, which sets the package version, builds the package, and publishes it directly to PyPI.