diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 2341239..1b81be0 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -212,7 +212,7 @@ jobs: release: name: Publish to PyPI if: ${{ startsWith(github.ref, 'refs/tags/v') }} - needs: [linux, musllinux, sdist] + needs: [musllinux, sdist] runs-on: ubuntu-latest permissions: id-token: write diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7cd3113..21db282 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -100,11 +100,18 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | set -euo pipefail - curl -sS -X POST \ + status=$(curl -sS -o /tmp/ci_dispatch_response.json -w "%{http_code}" -X POST \ -H "Authorization: Bearer ${GITHUB_TOKEN}" \ -H "Accept: application/vnd.github+json" \ "https://api.github.com/repos/${GITHUB_REPOSITORY}/actions/workflows/CI.yml/dispatches" \ - -d "{\"ref\":\"${{ steps.release_result.outputs.after_tag }}\"}" + -d "{\"ref\":\"${{ steps.release_result.outputs.after_tag }}\"}") + + if [ "${status}" != "204" ]; then + echo "::error::Failed to trigger CI.yml via workflow_dispatch (HTTP ${status})." + cat /tmp/ci_dispatch_response.json + exit 1 + fi + echo "Triggered CI.yml on tag ${{ steps.release_result.outputs.after_tag }}" - name: Skip CI trigger when no release diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8b26e43..a855cc1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -95,5 +95,28 @@ Include: - If commits do not qualify (for example docs/chore only), release is a no-op and no publish is triggered. - New `vX.Y.Z` tags trigger the CI workflow that builds multi-platform wheels and publishes to PyPI. +## Simple Trigger Guide (No-Ribet) + +Use this rule of thumb for automatic versioning: + +- `feat: ...` -> bump **minor** (for example `0.3.1` -> `0.4.0`) +- `fix: ...` or `perf: ...` -> bump **patch** (for example `0.3.1` -> `0.3.2`) +- `feat!: ...` or commit body with `BREAKING CHANGE:` -> bump **major** +- `docs:`, `chore:`, `test:` only -> no release + +How to trigger semantic release until publish to PyPI: + +1. Push commit to `dev` using Conventional Commit format. +2. Open PR from `dev` to `main`. +3. Merge PR. +4. Semantic Release workflow runs, creates tag `vX.Y.Z` when releasable commits exist. +5. CI workflow runs on that tag and publishes artifacts to PyPI. + +Manual fallback (if needed): + +1. Open Actions tab. +2. Run `Semantic Release` workflow via `workflow_dispatch`. +3. If no releasable commit exists, workflow will report no new release. + Required repository secrets: - `PYPI_API_TOKEN`: token used by publish job to upload wheels/sdist to PyPI.