Skip to content

ci: automate PyPI publishing from stable GitHub releases - #146

Merged
sxshco merged 1 commit into
mainfrom
codex/automate-pypi-release
Oct 27, 2026
Merged

sxshco merged 1 commit into
mainfrom
codex/automate-pypi-release

Conversation

@sxshco

@sxshco sxshco commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A published stable GitHub Release now triggers PyPI publication using its existing wheel and sdist. A manual main-branch dispatch can retry or backfill a tag. Preparation verifies release attachments, SHA256SUMS, package name/version and existing PyPI files; identical files are skipped, partial uploads resume, and conflicting or yanked files fail visibly. Upload runs in a separate Ubuntu job using the encrypted PYPI_API_TOKEN secret. A final job verifies registry hashes and installs the exact wheel from official PyPI in a clean environment, including dependency and CLI checks.

Adds English/Chinese maintainer guides covering draft-first asset attachment, retries, the GitHub-token event limitation and optional future Trusted Publishing migration. Release package versions remain 1.1.1 because this change only adds release infrastructure.

Validation

  • 16 focused unit tests passed (corrupt/missing assets, metadata and tag validation, conflicting/yanked/duplicate PyPI files, partial upload retries and install provenance).
  • Ruff and actionlint passed for the new scripts/workflows.
  • Downloaded the real v1.1.1 GitHub Release assets with the new preparation script: both hashes and metadata matched; PyPI already contains identical bytes, so zero uploads were staged.
  • Checked the real v1.1.1 official-PyPI installation report against the release wheel hash.

Production workflow validation: run 40458950651 passed all three jobs on main using v1.1.1. The encrypted secret was available, existing files were safely skipped, registry hashes matched, and a clean Ubuntu/Python 3.12 install from official PyPI passed provenance, dependency and CLI checks. This validates the no-op/retry path; it does not exercise a new authenticated upload. Main and dev were synchronized by a non-forced fast-forward after checking that the only file differences were these release-automation changes.

@sxshco
sxshco merged commit 5ea7313 into main Oct 27, 2026
1 check passed
@sxshco
sxshco deleted the codex/automate-pypi-release branch October 27, 2026 12: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