ci(release): skip publish + PyPI upload when there is no release - #13
Merged
Conversation
A no-release push to main (ci/docs/chore/style commits) makes semantic-release build no dist/, so the unconditional `twine upload dist/*` failed with 'Cannot find file (or expand pattern): dist/*'. Guard the publish + upload on a non-empty dist/ so the Release job succeeds cleanly when no version is cut. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Make the Release job tolerate no-release pushes
Problem
Merging #12 (a
ci:commit) turned the Release run red:semantic-releasebuildsdist/via itsbuild_command(uv build) only when a release iswarranted. A no-release push (any
ci/docs/chore/stylecommit) leavesdist/empty,but the job then unconditionally runs
twine upload dist/*, which fails on the empty glob. This is alatent gap — the first non-version-bumping commit to land on
mainwould always have hit it.Fix
Guard the publish + PyPI upload on a non-empty
dist/:versionrunsuv build→dist/populated → publish + PyPI uploadrun exactly as before. No behavior change.
dist/empty → publish/upload skipped → the job exits green.Verified: YAML parses; the guard skips on both a missing and an empty
dist/, and publishes when awheel is present.
Side benefit
Once this lands and the Release run for
mainconcludes success, the newdocker-publishworkflow (from #12) fires onworkflow_runcompletion and publishes the firstghcr.io/codemug/aiofmp-mcp-serverimage (1.4.0+latest) — which was skipped while the Releaserun was failing.
🤖 Generated with Claude Code