Skip to content

Publish to PyPI on tag, and release 0.5.1 - #86

Merged
bmxcode merged 2 commits into
mainfrom
pypi-publishing
Sep 5, 2026
Merged

bmxcode merged 2 commits into
mainfrom
pypi-publishing

Conversation

@bmxcode

@bmxcode bmxcode commented Sep 5, 2026

Copy link
Copy Markdown
Owner

What this does

Makes samplerdisc installable from PyPI (uv tool install samplerdisc, uvx samplerdisc, pipx/pip) and adds the automation that keeps it there. The conversion code is untouched — this is distribution only.

The release path

A new Release workflow (.github/workflows/release.yml) fires on a vX.Y.Z tag and, in two jobs:

  • build — checks out, builds the sdist + wheel with uv build, runs twine check, and uploads the artifacts. A guard fails the run if the git tag disagrees with the packaged version (uv version --short), the same "enforced, not remembered" reflex as ci.yml's no-media check — a tag can never publish the wrong number under the right name.
  • publish — downloads the artifacts and uploads them through PyPI Trusted Publishing (OIDC) via pypa/gh-action-pypi-publish, gated on a pypi GitHub environment restricted to v* tags. No API token lives in the repo; each run mints a short-lived credential.

A release is therefore just git tag vX.Y.Z && git push --tags.

Why no token

This repo is public. A long-lived PyPI token stored as a secret is the thing that leaks; Trusted Publishing removes it entirely by trusting this repository's pypi environment to mint a per-run OIDC credential. The environment's v*-tag rule means only a tagged release can request it.

Packaging notes

The wheel ships only the samplerdisc/ package — verified that out/, tests/, and scripts/ are excluded. twine check passes on both artifacts. The existing metadata in pyproject.toml (classifiers, keywords, license, URLs, console entry point) was already release-ready and is unchanged.

What it deliberately does not claim

  • No change to what the tool reads or writes; extraction behaviour is identical to 0.5.0.
  • Re-pushing the pre-existing v0.5.0 tag will not publish — that commit predates release.yml. This is why the PR bumps to 0.5.1, so merging leaves main immediately taggable for the debut publish (which, being a pending publisher, is what creates the project on PyPI).

After merge

  1. git tag v0.5.1 && git push origin v0.5.1
  2. Watch the Release run; the first success creates the project and converts the pending publisher to a normal one.

🤖 Generated with Claude Code

bmxcode and others added 2 commits September 5, 2026 21:44
Add a Release workflow that builds the sdist and wheel with uv and
uploads them to PyPI through OIDC Trusted Publishing when a v* tag is
pushed. No API token is stored in the repo: PyPI is configured to trust
this repository's `pypi` environment and each run mints a short-lived
credential. A guard fails the release if the git tag disagrees with the
pyproject version, and `twine check` gates on the metadata rendering.

README now leads with `uv tool install samplerdisc` (plus uvx/pipx/pip),
keeping the git+ install as the unreleased-main option, and gains a PyPI
version badge.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Bump to 0.5.1 and record the PyPI availability in the changelog. No
change to the conversion; this exists so that merging the release
workflow leaves `main` immediately taggable for the debut publish.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bmxcode
bmxcode merged commit eb1e15b into main Sep 5, 2026
2 checks passed
@bmxcode
bmxcode deleted the pypi-publishing branch September 5, 2026 11:57
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