Skip to content

Switch releases to tag-driven OIDC trusted publishing - #56

Merged
Apakottur merged 5 commits into
mainfrom
release-oidc-trusted-publishing
Jul 10, 2026
Merged

Switch releases to tag-driven OIDC trusted publishing#56
Apakottur merged 5 commits into
mainfrom
release-oidc-trusted-publishing

Conversation

@Apakottur

@Apakottur Apakottur commented Jul 10, 2026

Copy link
Copy Markdown
Owner

What

Reworks the release pipeline to follow current best practice, matching how projects like watchfiles and ruff release, and fixes the package's dependency metadata.

Apakottur and others added 5 commits July 10, 2026 15:43
Move release from a pyproject.toml path-filter trigger to git tags, and
publish to PyPI via Trusted Publishing (OIDC) instead of a stored token.

- Derive the package version from the git tag via hatch-vcs, so it no
  longer lives in pyproject.toml (removes version duplication and the
  manual bump PR step).
- Trigger the Release workflow on `v*` tags; use `id-token: write` with
  `uv publish --trusted-publishing always` (no PYPI_TOKEN secret).
- Create a GitHub Release with auto-generated notes on each release.
- Drop the curl PyPI-exists check; tags are inherently idempotent.
- Document the tag-based release flow in the README.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
shpyx has no runtime dependencies, but mypy/pytest/ruff/ty/pre-commit
were listed under [project.dependencies], so they were installed for
every end user of the package. Move them to a [dependency-groups] dev
group, which uv still syncs by default for local dev and CI.

The published wheel now has zero Requires-Dist.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Interactive helper that dogfoods shpyx to run the git commands. It:

- verifies the working tree is clean and on `main`;
- fetches and fast-forwards to `origin/main`;
- reads the latest published version from PyPI and prompts for the next
  one (patch / minor / major);
- offers to delete a pre-existing tag (e.g. from a failed release run)
  before recreating it;
- creates and pushes the `v*` tag that triggers the Release workflow.

The shebang uses `uv run`, so `./scripts/release.py` works without a
manually activated virtualenv. Ignore T201 (print) under scripts/.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Remove scripts/release.py (and its scripts/* ruff ignore) and revert the
README release section to the manual tag instructions. The script will
land in a follow-up PR.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Apakottur
Apakottur merged commit 4c5c0cf into main Jul 10, 2026
22 checks passed
@Apakottur
Apakottur deleted the release-oidc-trusted-publishing branch July 10, 2026 16:17
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.

1 participant