Skip to content

Add tag-triggered PyPI / TestPyPI publish workflow (Trusted Publishing) - #3

Merged
vectorsss merged 1 commit into
masterfrom
add-publish-workflow
Jun 17, 2026
Merged

vectorsss merged 1 commit into
masterfrom
add-publish-workflow

Conversation

@vectorsss

Copy link
Copy Markdown
Owner

Adds .github/workflows/publish.yml: on a tag push (v*), build the package and route by PEP 440 pre-release status.

  • Final versions (v0.15.0, v1.0.0) → PyPI
  • Pre-releases (v0.15.0rc1, v0.15.0a1, v0.15.0.dev1) → TestPyPI

Auth is PyPI Trusted Publishing (OIDC) — no API tokens/secrets.

Required one-time setup (before the first publish)

1. GitHub environments (repo Settings → Environments): create pypi and testpypi.

2. PyPI trusted publisher (https://pypi.org/manage/project/shapG/settings/publishing/ → Add):

  • Owner: vectorsss, Repository: shapG
  • Workflow name: publish.yml
  • Environment name: pypi

3. TestPyPI trusted publisher (https://test.pypi.org/manage/project/shapG/settings/publishing/ → Add): same, with Environment name testpypi.

Usage

git tag v0.15.0rc1 && git push origin v0.15.0rc1   # -> TestPyPI
git tag v0.15.0    && git push origin v0.15.0       # -> PyPI

Note: the existing v0.14.1 tag predates this workflow, so it won't auto-publish.

🤖 Generated with Claude Code

On a tag push (v*), build the sdist+wheel and route by PEP 440 pre-release
status: final versions (e.g. v0.15.0) publish to PyPI, pre-releases (e.g.
v0.15.0rc1, v0.15.0.dev1) publish to TestPyPI. Authentication uses PyPI
Trusted Publishing (OIDC) via pypa/gh-action-pypi-publish with the `pypi`
and `testpypi` GitHub environments -- no API tokens or secrets.
@vectorsss
vectorsss merged commit 7c9a369 into master Jun 17, 2026
3 checks passed
@vectorsss
vectorsss deleted the add-publish-workflow branch June 17, 2026 23:22
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