fix: checkout release tag in build job, add manual re-publish trigger#30
Merged
fix: checkout release tag in build job, add manual re-publish trigger#30
Conversation
Root cause of 0.1.3 not publishing to PyPI: the build job used actions/checkout@v6 without a ref, so it checked out GITHUB_SHA (the triggering commit) rather than the release tag. When the release-please action tags a release during an earlier push, the build job can check out a commit where pyproject.toml still has the old version, causing a version mismatch and build failure. Fixes: - Build job now checks out the release tag ref explicitly, ensuring pyproject.toml always matches the tagged version - Derive expected version from the tag name instead of the release-please version output (more reliable) - Add workflow_dispatch with a tag input so failed releases can be re-published without needing a new commit: run the workflow manually with tag=promptfoo-v0.1.3 to re-trigger build+publish - Run unit tests in the build job before publishing (was just an import check before) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1978709 to
9fce373
Compare
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.
Problem
promptfoo0.1.3 never published to PyPI. Root cause:The
buildjob usedactions/checkout@v6without aref, so it checked outGITHUB_SHA— the commit that triggered the push event. Whenrelease-pleasecreates a release tag during an earlier push (before the version-bump PR is merged), the build job ends up checking out a commit wherepyproject.tomlstill has the old version. Version mismatch →exit 1→ artifact never uploaded → PyPI publish never ran.Concretely for 0.1.3: release-please tagged
promptfoo-v0.1.3when PR #28 (README) was merged, butpyproject.tomlat that commit said0.1.2. Build failed. PR #29 (version bump to 0.1.3) merged moments later, but by thenrelease_createdwas alreadyfalsefor that run.Fixes
ref: ${{ steps.resolve.outputs.tag }}) instead ofGITHUB_SHA, sopyproject.tomlalways matches the tagged version${TAG#promptfoo-v}) rather thanrelease-pleaseoutput — more robust to timing issuesworkflow_dispatchwithtaginput so a failed release can be re-published without any new commits — just run the workflow manually withtag=promptfoo-v0.1.3Immediate action needed
After this merges, manually trigger the workflow to publish 0.1.3:
Test plan
tag=promptfoo-v0.1.3promptfoo==0.1.3appears on PyPI