Skip to content

Add Trusted Publishing workflow for PyPI and TestPyPI - #11

Merged
mehmetkr merged 1 commit into
mainfrom
item-12-trusted-publishing
Nov 27, 2026
Merged

mehmetkr merged 1 commit into
mainfrom
item-12-trusted-publishing

Conversation

@mehmetkr

Copy link
Copy Markdown
Owner

Summary

  • Adds .github/workflows/publish.yml with OIDC Trusted Publishing (no API tokens)
  • Three-job pipeline: build (sdist + wheel) → publish to TestPyPI → publish to PyPI
  • Build job has no OIDC token (trust isolation); each publish job gets id-token: write at job level only
  • Explicit tag checkout via ref: github.event.release.tag_name
  • Triggers on release: published (created by release-please)

Prerequisites before first release

  1. Create GitHub environments testpypi and pypi in repo Settings
  2. Register pending publishers on test.pypi.org and pypi.org (project: triggerdev, owner: mehmetkr, repo: triggerdev-python, workflow: publish.yml)

Test plan

  • CI passes (workflow file does not affect lint/typecheck/test)
  • YAML syntax is valid
  • Workflow-level permissions are contents: read only
  • id-token: write scoped to publish jobs, not build job
  • Sequential dependency: build → testpypi → pypi

@mehmetkr
mehmetkr merged commit d6e2a53 into main Nov 27, 2026
7 checks passed
@mehmetkr
mehmetkr deleted the item-12-trusted-publishing branch November 27, 2026 18:33
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