Skip to content

Harden the release workflow: SHA-pin the publisher, smoke the artifacts - #130

Merged
roed314 merged 1 commit into
roed314:mainfrom
roed-math:release-hardening
Jul 22, 2026
Merged

Harden the release workflow: SHA-pin the publisher, smoke the artifacts#130
roed314 merged 1 commit into
roed314:mainfrom
roed-math:release-hardening

Conversation

@roed-math

Copy link
Copy Markdown

Pre-release hardening of release.yml, per review:

  • SHA-pin the publish action. pypa/gh-action-pypi-publish holds the OIDC publishing authority, so it's now pinned to a full commit SHA (ba38be9e… = v1.14.1, verified against the action repo's tags) instead of the mutable release/v1 branch. Bumping it becomes a deliberate, reviewable act.
  • Smoke job between build and publish. Installs both freshly built artifacts — wheel and sdist — into clean venvs, imports the package, and runs pip check; publish now needs: [build, smoke]. An artifact that can't install fails before anything reaches PyPI. Both steps verified locally against a fresh build (whl ok: 1.0.0rc1, tar.gz ok: 1.0.0rc1, no broken requirements).
  • Required reviewer, firmly recommended. The one-time-setup notes now tell the maintainer to add themself as a required reviewer on the pypi environment (publish = tag push plus a deliberate approval click), rather than mentioning reviewers as optional. The environment setting itself remains a repository-settings step only a maintainer can do.

No trigger or flow changes otherwise; the tag-vs-version guard from #113 is untouched. Should land before v1.0.0rc1 is published so the rehearsal exercises the final workflow.

🤖 Generated with Claude Code

Three pre-release hardenings:

- pypa/gh-action-pypi-publish is the one action holding OIDC publishing
  authority, so it is pinned to a full commit SHA
  (ba38be9e461d3875417946c167d0b5f3d385a247 = v1.14.1) rather than the
  mutable release/v1 branch; bumping it is now a deliberate act.

- A smoke job between build and publish installs BOTH freshly built
  artifacts (wheel and sdist) into clean virtual environments, imports
  the package and runs pip check -- an artifact that cannot even install
  fails before anything reaches PyPI.  (Both steps verified locally
  against a fresh build: import ok, no broken requirements.)

- The one-time-setup notes now firmly recommend a required reviewer on
  the pypi environment -- publishing then always takes a second,
  deliberate approval after the tag push -- instead of mentioning
  reviewers as optional.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@roed314
roed314 merged commit f5a45da into roed314:main Jul 22, 2026
19 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