Skip to content

ci: auto-publish to PyPI on main push (OIDC trusted publishing)#189

Merged
cipher813 merged 1 commit into
mainfrom
ci/pypi-auto-publish-on-main
Jun 4, 2026
Merged

ci: auto-publish to PyPI on main push (OIDC trusted publishing)#189
cipher813 merged 1 commit into
mainfrom
ci/pypi-auto-publish-on-main

Conversation

@cipher813
Copy link
Copy Markdown
Owner

Why

You asked why mnemon doesn't just auto-publish on merge like the rest of the fleet. No good reason — it was the outlier. alpha-engine-lib and morning-signal both auto-publish on main-push via OIDC trusted publishing; mnemon kept a manual scripts/promote_stable.sh pipeline, which is how rc7 (and historically other rcs) ended up sitting on main while PyPI lagged.

What

publish.yml mirroring the two existing fleet workflows exactly:

  • build job: python -m build (sdist + wheel) + twine check.
  • publish job: pypa/gh-action-pypi-publish via OIDC trusted publishing (id-token: write, environment: pypi, no API-token secret), skip-existing: true.
  • Trigger: push: branches: [main] (the merge itself) + workflow_dispatch for manual/recovery.

A version bump auto-publishes on merge; an unchanged version is a clean no-op (skip-existing). promote_stable.sh stays for manual/stable releases and recovery.

Tradeoff (called out)

The manual pipeline had a testpypi pre-flight + layer3 tool-exercise smoke that auto-on-main drops. CI already gates every merge on the full suite (1012 tests), so this is a modest loss and matches the fleet convention. promote_stable.sh remains for when the full gated flow is wanted (stable releases).

⚠️ One-time operator step required before this can publish

OIDC trusted publishing needs a trusted publisher configured on PyPI (account-side, only you can do it). On pypi.org → mnemon-memory → Settings → Publishing → Add a trusted publisher:

  • Owner: cipher813 · Repository: mnemon · Workflow: publish.yml · Environment: pypi

Until that's added, the build job passes but the publish job will fail auth on the first run. After adding it, re-run via workflow_dispatch (or it fires on the next main push). The first successful run will publish the current version — rc7 (currently on main, not yet on PyPI).

Note

mnemon's pyproject.toml description is 54 chars — well under PyPI's 512-char core-metadata cap (the gotcha that bit alpha-engine-lib), so no guard needed here.

🤖 Generated with Claude Code

mnemon was the fleet outlier still publishing via the manual
scripts/promote_stable.sh pipeline, which left rc7 (and historically
other rcs) on main but unpublished. Add publish.yml mirroring
alpha-engine-lib / morning-signal: build sdist+wheel + twine check, then
publish via OIDC trusted publishing on every push to main, idempotent
via skip-existing so no-version-bump merges are a clean no-op.

promote_stable.sh stays for manual/stable releases + recovery;
workflow_dispatch covers the one-time pending-trusted-publisher
bootstrap and failed-first-attempt reruns.

Requires a one-time PyPI-side step (operator): add a trusted publisher
to the mnemon-memory project (owner=cipher813, repo=mnemon,
workflow=publish.yml, environment=pypi) before the first run can publish.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cipher813 cipher813 merged commit 6372aaa into main Jun 4, 2026
9 of 10 checks passed
@cipher813 cipher813 deleted the ci/pypi-auto-publish-on-main branch June 4, 2026 16:54
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