✨ chore(publish): improve PyPI workflow gating and bump logic Add a CI to gate the workflow and skip expensive steps for release commits, preventing double publishing and runs- publish workflow into two jobs (ci -> publish) and publish depend on ci to early exit and clearer job. - #22
Conversation
…I to gate the workflow and skip expensive steps for release commits, preventing double publishing and runs- publish workflow into two jobs (ci -> publish) and publish depend on ci to early exit and clearer job. - Tighten repo-only conditionals and set fetch-depth:0 for full git history for version operations. - OIDC and contents permissions clearer. - Simplify and harden version bump step: - standardize step id bump and COMMIT_MESSAGE env. - detect [MAJOR]/[MINOR]/[PATCH] markers in commit (case- insensitive) and to minor. - emit part to GITHUB_OUTPUT downstream use. - Update bump/commit behavior - use-actionsbot] identity to make trace and avoid ambiguous author info. - call bump-my-version with the selected part and push follow-tags. - Remove local version extraction consolidate bump+push. - Rename step title and Hatch build unchanged. Motivation: make automated versioning and publishing robust, prevent accidental double on release commits, and simplifycommit-message-driven version bumps.
Review Summary by QodoImprove PyPI workflow gating and automate version bumping
WalkthroughsDescription• Split publish workflow into CI gate and publish jobs - CI job skips on release commits to prevent double publishing - Publish job depends on CI for clearer execution flow • Simplify version bump detection with case-insensitive markers - Detect [MAJOR]/[MINOR]/[PATCH] in commit messages - Default to minor bump if no marker found • Use github-actions[bot] identity for clearer commit attribution • Automate CHANGELOG rotation via bump-my-version configuration • Update python-package workflow to support workflow_call and main branch • Improve justfile commands for dev setup and release workflow Diagramflowchart LR
A["Push to main"] --> B["CI Job"]
B --> C{Release commit?}
C -->|Yes| D["Skip workflow"]
C -->|No| E["Publish Job"]
E --> F["Detect bump type"]
F --> G["Bump version & CHANGELOG"]
G --> H["Build & publish to PyPI"]
File Changes1. .github/workflows/publish-pypi.yml
|
Code Review by Qodo
1.
|
…flow to rebase local main before bumping version to avoid stale refs and ensure bump-my-version operates on up-date history. - Remove redundant git fetch/re after bump and push --follow-tags. - Narrow python-package workflow to trigger pushes only on develop to prevent accidental builds from main; keep PR triggers for develop/main. - Standard developer install instructions replace ad-h invocations with just install-dev in CONTRIBUTING and GEMINI to match current Justfile and simplify onboarding. Rationale: - Prevent release failures caused by out-of-date main in CI and reduce git operations. - Align repository docs with actual tooling and minimize confusion for contributors.
history for version operations.
insensitive) and to minor.
and avoid ambiguous author info.
Motivation: make automated versioning and publishing robust,
prevent accidental double on release commits, and
simplifycommit-message-driven version bumps.