ci: build the Docker image after PyPI publish finishes, not alongside it - #64
Merged
Conversation
The image installs `glq==<version>` from PyPI, so it cannot be built until that version
exists. docker.yml triggered on the tag push — and so does publish.yml, in the same
instant, so the build raced the upload and lost:
ERROR: Could not find a version that satisfies the requirement glq==0.8.7
(from versions: ..., 0.8.5, 0.8.6)
three minutes into a build that started in the same second as the wheel matrix. **v0.8.6
and v0.8.7 both failed this way and neither release produced an image**; it went unnoticed
for two releases because the failure is in a workflow nobody watches after tagging.
The file's own comment argued that tags-only kept it green ("a main-push build would always
fail ... restricting to tag pushes keeps this workflow reliably green"). That reasoning
holds for main pushes and does nothing for the tag itself, which fires both workflows at
once. Comment corrected along with the trigger, since the wrong rationale is what would
send the next person back to the same design.
Now: `workflow_run` on Publish-to-PyPI completing, gated on conclusion == success and a
`v*` head_branch, checking out that tag rather than the default branch.
Then it waits for the **simple index** — what pip actually resolves against, CDN-served and
lagging even after publish reports success. Measured on 0.8.6: a container started 2m16s
after publish installed 0.8.5 and produced a green log proving the previous release's
behaviour. Ten-minute cap, and the failure message points at the upload rather than at this
build.
Not fixed here: 0.8.6 and 0.8.7 have no image on ghcr. Both can be built with
workflow_dispatch now that the versions are on PyPI.
cnygaard
enabled auto-merge (squash)
August 17, 2026 22:09
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 free
to 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.
docker.ymltriggered onpush: tags— and so doespublish.yml. A tag fires both at the same instant, and the image installsglq==<version>from PyPI, so the build raced the upload and lost:three minutes into a build that started in the same second as the wheel matrix.
This has been broken for two releases
It went unnoticed because nothing looks at this workflow after tagging, and the release itself succeeds — PyPI gets its wheels, the GitHub release gets created, only the container is silently missing.
The file's own comment claimed tags-only was the fix:
True for main pushes, irrelevant for the tag. The comment is corrected along with the trigger, since leaving the wrong rationale in place is what would send the next person back to the same design.
Change
workflow_runon "Publish to PyPI" completing, gated onconclusion == 'success'and av*head_branch. A failed or partial publish must not produce an image claiming that version.head_branch—workflow_runotherwise defaults to the default branch, which would build the Dockerfile andinstall.shfrom main rather than from the tag.Not fixed here
0.8.6 and 0.8.7 still have no image on ghcr. Both can be built with
workflow_dispatchnow that the versions are on PyPI — worth doing, since the README points atghcr.io/cnygaard/glq-env:latestin five places.