Skip to content

Add a release workflow and release 0.4.1 to PyPI - #20

Merged
chrisjkuch merged 6 commits into
mainfrom
release-workflow
Nov 20, 2026
Merged

chrisjkuch merged 6 commits into
mainfrom
release-workflow

Conversation

@jayqi

@jayqi jayqi commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Adds a Release workflow that publishes pdc-api to PyPI and creates the GitHub release, points the README at PyPI, and bumps the version to 0.4.1 for the first PyPI release.

Release workflow

Run it from the Actions tab with a tag such as v0.5.0. It:

  1. Checks that the release runs from main, the tag matches the version in pyproject.toml, the tag doesn't exist yet, and CHANGELOG.md has a dated heading for the version.
  2. Extracts that changelog entry for the release notes.
  3. Builds and inspects the package with hynek/build-and-inspect-python-package, with a build provenance attestation.
  4. Uploads to Test PyPI from the test-pypi environment.
  5. Uploads to PyPI from the pypi environment, which requires a reviewer and only allows main.
  6. Creates the tag and GitHub release on the commit it ran on, with the wheel and sdist attached. Releases are immutable, so the tag and files can't change once it's published.

Dry run is checked by default. A dry run stops after Test PyPI and prints what the release would contain. It needs no approval.

Both PyPI uploads use trusted publishing.

Docs

  • CONTRIBUTING.md gets a Releasing section.
  • AGENTS.md says releases go through the workflow and new changelog entries go under ## Unreleased.
  • README.md installs from PyPI, and its CONTRIBUTING and LICENSE links are absolute so they work on the PyPI project page.
  • CHANGELOG.md has a 0.4.1 entry announcing the PyPI package.

Setup

  • test-pypi environment
  • pypi environment, with required reviewers and deployments only from main
  • Pending trusted publisher on Test PyPI
  • Pending trusted publisher on PyPI
  • Immutable releases on GitHub

After merging

Release 0.4.1 by following steps 2 to 5 of the new Releasing section in CONTRIBUTING.md: a dry run on main with the tag v0.4.1, then the real run. If the release slips past 2026-11-20, update the date in the changelog first.

Testing

  • zizmor (online) and actionlint pass.
  • The changelog check and extraction accept dated versions and reject a missing version, a partial version, and an Unreleased heading.
  • uv build, twine check --strict, and check-wheel-contents pass on the built package.
  • The workflow itself hasn't run yet, since it has to be on main before it can be dispatched.

Assisted by Claude Code

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
… steps

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
@jayqi jayqi changed the title Add a release workflow that publishes to PyPI Add a release workflow and release 0.4.1 to PyPI Nov 20, 2026
@jayqi
jayqi requested a review from chrisjkuch November 20, 2026 05:59
Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
@jayqi

jayqi commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator Author

@chrisjkuch this should be good to go for running the release workflow immediately after merging

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
@chrisjkuch
chrisjkuch merged commit 5a19550 into main Nov 20, 2026
8 checks passed
@chrisjkuch
chrisjkuch deleted the release-workflow branch November 20, 2026 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants