Skip to content

feat: add PyPI publishing workflow and readme metadata#2915

Open
mnriem wants to merge 2 commits into
mainfrom
mnriem/feat-2908-pypi-publishing
Open

feat: add PyPI publishing workflow and readme metadata#2915
mnriem wants to merge 2 commits into
mainfrom
mnriem/feat-2908-pypi-publishing

Conversation

@mnriem

@mnriem mnriem commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds infrastructure for publishing specify-cli to PyPI, addressing #2908.

Changes

  1. pyproject.toml — adds readme = "README.md" so PyPI displays the project description
  2. .github/workflows/publish-pypi.yml — new manual workflow for publishing to PyPI
  3. .github/workflows/release.yml — updates install instructions to prefer uv tool install specify-cli@latest

Publish Workflow Design

  • Manual trigger (workflow_dispatch) — run after the release workflow completes
  • Tag input — specify which release tag to publish (e.g., v0.10.1)
  • Validation — verifies tag format and that it matches pyproject.toml version
  • Trusted publishers (OIDC) — no API tokens needed; uses id-token: write permission
  • Protected environment — requires a pypi GitHub environment for deployment gating
  • Two-job split — build (no elevated permissions) → publish (OIDC only)

Prerequisites Before First Use

Testing

This workflow won't run until manually triggered with a valid tag, so it's safe to merge ahead of the PyPI ownership transfer.

- Add readme = "README.md" to pyproject.toml for PyPI project description
- Add manual publish-pypi.yml workflow using trusted publishers (OIDC)
- Update release.yml install instructions to prefer PyPI

The publish workflow is manually triggered after a release, checks out the
specified tag, verifies version consistency, builds with uv, and publishes
using trusted publishing (no API tokens required).

Prerequisites before first use:
- Take ownership of the specify-cli PyPI project (#2908)
- Create a 'pypi' environment in repo settings
- Configure trusted publisher on PyPI for this repo/workflow

Closes #2908

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 10, 2026 13:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds release infrastructure to publish specify-cli to PyPI and improve the package’s PyPI description rendering, aligning with the goal that uv tool install specify-cli@latest works reliably.

Changes:

  • Add readme = "README.md" to pyproject.toml so PyPI renders the README.
  • Introduce a manual GitHub Actions workflow to build and publish to PyPI via trusted publishing (OIDC).
  • Update release notes generation to prefer uv tool install specify-cli@latest, with a source-install fallback.
Show a summary per file
File Description
pyproject.toml Adds README metadata for PyPI rendering.
.github/workflows/publish-pypi.yml New manual build+publish workflow using artifacts + OIDC trusted publishing.
.github/workflows/release.yml Updates generated release install instructions to prefer PyPI installs.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 3/3 changed files
  • Comments generated: 3

Comment thread .github/workflows/publish-pypi.yml
Comment thread .github/workflows/publish-pypi.yml
Comment on lines +31 to +39
- name: Verify tag matches package version
run: |
TAG_VERSION="${{ inputs.tag }}"
TAG_VERSION="${TAG_VERSION#v}"
PROJECT_VERSION="$(python3 -c 'import tomllib; print(tomllib.load(open("pyproject.toml","rb"))["project"]["version"])')"
if [[ "$TAG_VERSION" != "$PROJECT_VERSION" ]]; then
echo "Error: Tag version ($TAG_VERSION) does not match pyproject.toml version ($PROJECT_VERSION)"
exit 1
fi
- Add actions: read permission (required for artifact upload/download)
- Move version check after uv install and use uv run python (ensures
  Python >=3.11 with tomllib is available regardless of runner image)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@youngjoel

Copy link
Copy Markdown

Note that PyPI does not host image files, so relative image paths from your local repository (e.g., My Image) will appear broken. To fix this, you must change your image URLs to absolute paths pointing to an external file host, such as the ://githubusercontent.com URL for your repository.

You can see this here: https://pypi.org/project/specify-cli/ , where the Spec Kit logo isn't rendered.

pypi/warehouse#5246

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.

3 participants