ci: publish from release-please outputs and allow manual dispatch - #69
Merged
Conversation
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The defect
v0.1.0is tagged and its GitHub Release is published, PR #67 flipped toautorelease: tagged— butpublish_pypi.yamlnever ran, so nothing wasuploaded to PyPI, GHCR or the versioned docs.
GitHub does not trigger workflows from events created with the default
GITHUB_TOKEN. It is a deliberate recursion guard with no opt-out short ofpushing the tag with a PAT.
release-please-actiontags with that token, andpublish_pypi.yamltriggered only onpush: tags: ["v*"], so it could neverfire from a release-please tag.
Evidence:
v0.1.0→daed7c09e64fc337078daf6b9459b5ce0f9a8021, and the GitHub Releaseis authored by
github-actions[bot].gh run listshows Publish Release with no run at all — not a failedone, not a skipped one. It was never started.
Fix 1 — make this release publishable (
workflow_dispatch)publish_pypi.yamlgainsworkflow_dispatchwith a requiredtaginput, sothe existing
v0.1.0tag can be published by hand without re-tagging anything.On a dispatched run
github.refis the branch andgithub.ref_nameismain,not
v0.1.0, so every reference to the tag had to be audited. All four are now${{ inputs.tag || github.ref_name }}— the input on a dispatched or called run,the pushed tag otherwise:
buildcheckoutref:(previously defaulted to the branch on dispatch)ghcrcheckoutref:and theghcr.io/nadeem4/nl2sql-api:<tag>image tagdocscheckoutref:andmike deploy --push --update-aliases "$TAG" latest(was
$GITHUB_REF_NAME, which would have deployed a docs version literallynamed
mainand movedlatestonto it)A dispatch therefore builds, publishes and documents the tagged commit, not
whatever
mainhappens to be — which matters here, sincemainhas alreadymoved past the tag (#68).
Fix 2 — stop depending on the cross-workflow trigger
release_please.ymlnow gives the action step anid, re-exports its outputs onthe job, and calls the publish directly:
Output names confirmed from the action's own README at
v4, not assumed:releases_created— "trueif any release was created,falseotherwise"; andunder Root component outputs (which apply because this repo's manifest has a
single package at path
.),tag_name— "Directly related to Create arelease API".
workflow_call, not a duplicate pipeline. The build → smoke gate → threePyPI legs → GHCR → docs chain stays in
publish_pypi.yamlunchanged, which isalso the workflow filename registered with PyPI's trusted publishers — the
pypijob's OIDC claim still names it, so no publisher entry changes. Thealternative (moving publish jobs into
release_please.yml) would have renamedthe workflow PyPI trusts and broken all three registrations.
id-token: writereaches thepypilegs fine: a called workflow's jobs cannever hold more than the calling job grants, so the caller declares the
ceiling and each inner job keeps its own narrower
permissionsblock.No PAT and no new secret. Trusted publishing was chosen to avoid stored
credentials; working around the trigger rule with a token would have defeated
that. The
push: tags: ["v*"]trigger is kept as well — it costs nothing andstill covers a tag a human pushes by hand.
Unchanged
build(build 3 dists → smoke-install →import nl2sql→nl2sql --help) stillneeds-precedespypi, andghcrand
docsbothneeds: pypi. If the wheels do not install and import,nothing publishes.
pypi-nl2sql-engine,pypi-nl2sql-api,pypi-nl2sql-adapter-sdk— are the contract with PyPI's pending publishersand are byte-identical.
CHANGELOG.mdor.release-please-manifest.jsonchange.Docs
docs/development/releasing.mdgains two greppable subsections — Why thepublish is chained to release-please, not to the tag and Publishing a release
manually (
gh workflow run publish_pypi.yaml -f tag=v0.1.0).mkdocs build --strictis clean.Next step after merge
v0.1.0is already tagged, so this change cannot retroactively trigger it.The first publish will be a manual dispatch against the existing tag; every
release after this one publishes automatically off release-please's outputs.