From 264c33e421991c3a15e879bd3fb18db763705cb0 Mon Sep 17 00:00:00 2001 From: 35C4n0r Date: Sun, 24 May 2026 10:59:29 +0530 Subject: [PATCH] fix(ci): trigger PyPI publish after Release workflow, not on release event - release: published fires as soon as a GitHub Release exists, even with no assets attached; manually creating a release (or a race with the build job) caused pypi.yml to run before artifacts were uploaded - switch trigger to workflow_run on Release completion so pypi.yml only runs after the build job has uploaded the wheel and sdist - gate on conclusion == success so a failed release build does not attempt a publish - resolve the tag from workflow_run.head_branch for the automatic path and from inputs.tag for the manual workflow_dispatch path --- .github/workflows/pypi.yml | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 0bf9b11..41ff399 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -1,8 +1,9 @@ name: Publish to PyPI on: - release: - types: [published] + workflow_run: + workflows: ["Release"] + types: [completed] workflow_dispatch: inputs: tag: @@ -14,7 +15,11 @@ jobs: publish: name: Publish to PyPI runs-on: ubuntu-latest - if: github.repository == '35C4n0r/langgraph-ephemeral-checkpointer' + if: | + github.repository == '35C4n0r/langgraph-ephemeral-checkpointer' && ( + github.event_name == 'workflow_dispatch' || + github.event.workflow_run.conclusion == 'success' + ) environment: name: pypi url: https://pypi.org/project/langgraph-ephemeral-checkpointer/ @@ -24,8 +29,17 @@ jobs: contents: read steps: + - name: Resolve tag + id: tag + run: | + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + echo "value=${{ inputs.tag }}" >> "$GITHUB_OUTPUT" + else + echo "value=${{ github.event.workflow_run.head_branch }}" >> "$GITHUB_OUTPUT" + fi + - name: Download release assets - run: gh release download ${{ github.event.release.tag_name || inputs.tag }} --dir dist/ --repo ${{ github.repository }} + run: gh release download ${{ steps.tag.outputs.value }} --dir dist/ --repo ${{ github.repository }} env: GH_TOKEN: ${{ github.token }}