Skip to content

fix: checkout release tag in build job, add manual re-publish trigger#30

Merged
mldangelo merged 1 commit intomainfrom
fix/release-workflow
Feb 24, 2026
Merged

fix: checkout release tag in build job, add manual re-publish trigger#30
mldangelo merged 1 commit intomainfrom
fix/release-workflow

Conversation

@mldangelo
Copy link
Member

Problem

promptfoo 0.1.3 never published to PyPI. Root cause:

The build job used actions/checkout@v6 without a ref, so it checked out GITHUB_SHA — the commit that triggered the push event. When release-please creates a release tag during an earlier push (before the version-bump PR is merged), the build job ends up checking out a commit where pyproject.toml still 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.3 when PR #28 (README) was merged, but pyproject.toml at that commit said 0.1.2. Build failed. PR #29 (version bump to 0.1.3) merged moments later, but by then release_created was already false for that run.

Fixes

  • Checkout the release tag (ref: ${{ steps.resolve.outputs.tag }}) instead of GITHUB_SHA, so pyproject.toml always matches the tagged version
  • Derive expected version from the tag (${TAG#promptfoo-v}) rather than release-please output — more robust to timing issues
  • Add workflow_dispatch with tag input so a failed release can be re-published without any new commits — just run the workflow manually with tag=promptfoo-v0.1.3
  • Run unit tests in the build job before publishing (previously only did an import check)

Immediate action needed

After this merges, manually trigger the workflow to publish 0.1.3:

Actions → release-please → Run workflow → tag: promptfoo-v0.1.3

Test plan

  • Merge this PR
  • Manually run the release-please workflow with tag=promptfoo-v0.1.3
  • Verify promptfoo==0.1.3 appears on PyPI
  • Verify future releases build from the correct tag commit

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>
@mldangelo mldangelo force-pushed the fix/release-workflow branch from 1978709 to 9fce373 Compare February 24, 2026 22:11
@mldangelo mldangelo merged commit 5e0bd39 into main Feb 24, 2026
11 checks passed
@mldangelo mldangelo deleted the fix/release-workflow branch February 24, 2026 23:22
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