Skip to content

feat: add PyPI publish workflow (OIDC trusted publishing) - #260

Draft
Brian Krabach (bkrabach) wants to merge 1 commit into
mainfrom
feat/pypi-publish-workflow
Draft

feat: add PyPI publish workflow (OIDC trusted publishing)#260
Brian Krabach (bkrabach) wants to merge 1 commit into
mainfrom
feat/pypi-publish-workflow

Conversation

@bkrabach

Copy link
Copy Markdown
Collaborator

Summary

Adds a tag-driven GitHub Actions workflow for building and publishing the pure-Python sdist+wheel to PyPI via OIDC trusted publishing. Mirrors amplifier-core's proven pattern: push a v* git tag, CI builds and publishes automatically with no tokens in-repo.

Also adds RELEASING.md with version/tag conventions and publishing steps.

What this does

  • publish.yml: GitHub Actions workflow that triggers on v* tags

    • Builds pure-Python sdist + wheel
    • Publishes to PyPI via OIDC trusted publishing (no hardcoded tokens)
    • Includes a tag-vs-pyproject version-match guard so a mistagged release fails loudly instead of publishing the wrong version
    • Identical pattern to amplifier-core's proven automation
  • RELEASING.md: Documents version/tag conventions and the publish flow for future maintainers

Before this can publish

PyPI side setup (one-time):

  1. Configure a PyPI pending trusted publisher:
    • Project name: amplifier-foundation
    • Repository owner: microsoft
    • Repository name: amplifier-foundation
    • Workflow filename: publish.yml
    • Environment name: pypi
  2. Create a pypi environment in the GitHub repo (Settings → Environments)

Tagging and publishing:

  • To publish version X.Y.Z: git tag vX.Y.Z && git push --tags
  • CI detects the tag, validates version match, builds, and publishes

Validation

Locally validated via uv build:

  • Builds clean pure-Python sdist + wheel
  • No platform-specific code or build artifacts
  • Ready to push to PyPI

Note: The OIDC handshake itself (confirming the trusted publisher works) can only be validated by the first real tagged run after the trusted publisher is set up at PyPI.

Adds OIDC trusted publishing to PyPI via a tag-triggered workflow,
mirroring the pattern established in amplifier-core (push tags v*
+ workflow_dispatch, pypa/gh-action-pypi-publish, id-token:write).

Changes:
- .github/workflows/publish.yml: single ubuntu-latest job, uv build
  (sdist + py3-none-any wheel), OIDC publish on v* tags. Includes
  tag-vs-pyproject version verification gate.
- RELEASING.md: full release procedure (bump version → merge → push tag),
  one-time PyPI trusted publisher setup checklist (pending publisher for
  amplifier-foundation, pypi GitHub environment), and pre-release naming.

One-time action required before first publish:
  Configure PyPI pending trusted publisher for project amplifier-foundation,
  repo microsoft/amplifier-foundation, workflow publish.yml, env pypi.
  Create the pypi GitHub Actions environment in repo settings.
  The OIDC handshake is only provable via a real tag-triggered CI run.

🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier)

Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
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