Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 23 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Loading