Skip to content

Commit 73bb811

Browse files
fix(ci): publish to PyPI before tag/release + drop redundant dispatch guards
Address greptile P1 + P2: - P1: uv publish now runs before commit/tag/release. PyPI is the only irreversible step, so if a later git/release call fails the artifact is the source of truth and the metadata can be retried. - P2: workflow only triggers on workflow_dispatch (see top-level `on:`), so the per-step `if: github.event_name == 'workflow_dispatch'` guards were redundant and inconsistent (only on bookends, not lint/test/build). Removed them — any future trigger addition should be a deliberate per-step decision. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 0539a0f commit 73bb811

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

.github/workflows/main.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,8 @@ jobs:
6868
run: uv sync --dev
6969

7070
# Compute and stage the new version locally — defer commit/tag/release
71-
# until lint+tests+build pass so a verification failure leaves main untouched.
71+
# until lint+tests+build+publish all pass, so any failure leaves main untouched.
7272
- name: Compute new version
73-
if: github.event_name == 'workflow_dispatch'
7473
id: version
7574
run: |
7675
CURRENT_VERSION=$(grep -E "^__version__ = " src/unstract/api_deployments/__init__.py | sed -E 's/__version__ = "(.*)"/\1/')
@@ -115,9 +114,13 @@ jobs:
115114
- name: Build package
116115
run: uv build
117116

118-
# Only reached if lint/tests/build all passed — safe to commit, tag, release.
117+
# PyPI publish first because it is the only step that cannot be undone —
118+
# if a later commit/tag/release step fails, the PyPI artifact is the
119+
# source of truth and the git metadata can be retried manually.
120+
- name: Publish to PyPI
121+
run: uv publish
122+
119123
- name: Commit version bump and create release
120-
if: github.event_name == 'workflow_dispatch'
121124
run: |
122125
NEW_VERSION="${{ steps.version.outputs.version }}"
123126
@@ -146,9 +149,6 @@ jobs:
146149
env:
147150
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
148151

149-
- name: Publish to PyPI
150-
run: uv publish
151-
152152
- name: Success message
153153
run: |
154154
echo "Successfully published version ${{ steps.version.outputs.version }} to PyPI using uv publish with Trusted Publishers"

0 commit comments

Comments
 (0)