Skip to content

Add PyPI publish workflow via OIDC Trusted Publisher#1

Merged
wenfeng110402 merged 2 commits into
masterfrom
copilot/add-pypi-workflow
Feb 24, 2026
Merged

Add PyPI publish workflow via OIDC Trusted Publisher#1
wenfeng110402 merged 2 commits into
masterfrom
copilot/add-pypi-workflow

Conversation

Copilot AI commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

Adds a GitHub Actions workflow to automatically publish hackauth to PyPI on every GitHub Release, using OIDC Trusted Publisher — no API tokens or secrets required.

Workflow (.github/workflows/publish.yml)

  • Trigger: release: published
  • build job: checks out, builds sdist + wheel via python -m build (hatchling backend), uploads dist/ as artifact
  • publish job: downloads artifact, publishes to PyPI via pypa/gh-action-pypi-publish@release/v1 with id-token: write for OIDC; scoped to a pypi GitHub environment
  • Top-level permissions: contents: read for least-privilege GITHUB_TOKEN

Required one-time PyPI setup

Log into PyPI and configure a Trusted Publisher at https://pypi.org/manage/account/publishing/:

Field Value
Project name hackauth
GitHub owner wenfeng110402
Repository Authenticator
Workflow filename publish.yml
Environment pypi

Also create a pypi environment in GitHub repo Settings → Environments.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: wenfeng110402 <177030701+wenfeng110402@users.noreply.github.com>
Copilot AI changed the title [WIP] Add workflow for packaging to PyPI Add PyPI publish workflow via OIDC Trusted Publisher Feb 24, 2026
Copilot AI requested a review from wenfeng110402 February 24, 2026 07:35
@wenfeng110402 wenfeng110402 marked this pull request as ready for review February 24, 2026 07:41
@wenfeng110402 wenfeng110402 merged commit 44d13ce into master Feb 24, 2026
2 checks passed
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