Skip to content

Commit 6caf20c

Browse files
authored
Merge pull request #1 from krypton-byte/dev
fix(release): update CI workflow dependencies and improve error handl…
2 parents f92bd1d + b1acd07 commit 6caf20c

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ jobs:
212212
release:
213213
name: Publish to PyPI
214214
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
215-
needs: [linux, musllinux, sdist]
215+
needs: [musllinux, sdist]
216216
runs-on: ubuntu-latest
217217
permissions:
218218
id-token: write

.github/workflows/release.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,18 @@ jobs:
100100
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101101
run: |
102102
set -euo pipefail
103-
curl -sS -X POST \
103+
status=$(curl -sS -o /tmp/ci_dispatch_response.json -w "%{http_code}" -X POST \
104104
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
105105
-H "Accept: application/vnd.github+json" \
106106
"https://api.github.com/repos/${GITHUB_REPOSITORY}/actions/workflows/CI.yml/dispatches" \
107-
-d "{\"ref\":\"${{ steps.release_result.outputs.after_tag }}\"}"
107+
-d "{\"ref\":\"${{ steps.release_result.outputs.after_tag }}\"}")
108+
109+
if [ "${status}" != "204" ]; then
110+
echo "::error::Failed to trigger CI.yml via workflow_dispatch (HTTP ${status})."
111+
cat /tmp/ci_dispatch_response.json
112+
exit 1
113+
fi
114+
108115
echo "Triggered CI.yml on tag ${{ steps.release_result.outputs.after_tag }}"
109116
110117
- name: Skip CI trigger when no release

CONTRIBUTING.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,28 @@ Include:
9595
- If commits do not qualify (for example docs/chore only), release is a no-op and no publish is triggered.
9696
- New `vX.Y.Z` tags trigger the CI workflow that builds multi-platform wheels and publishes to PyPI.
9797

98+
## Simple Trigger Guide (No-Ribet)
99+
100+
Use this rule of thumb for automatic versioning:
101+
102+
- `feat: ...` -> bump **minor** (for example `0.3.1` -> `0.4.0`)
103+
- `fix: ...` or `perf: ...` -> bump **patch** (for example `0.3.1` -> `0.3.2`)
104+
- `feat!: ...` or commit body with `BREAKING CHANGE:` -> bump **major**
105+
- `docs:`, `chore:`, `test:` only -> no release
106+
107+
How to trigger semantic release until publish to PyPI:
108+
109+
1. Push commit to `dev` using Conventional Commit format.
110+
2. Open PR from `dev` to `main`.
111+
3. Merge PR.
112+
4. Semantic Release workflow runs, creates tag `vX.Y.Z` when releasable commits exist.
113+
5. CI workflow runs on that tag and publishes artifacts to PyPI.
114+
115+
Manual fallback (if needed):
116+
117+
1. Open Actions tab.
118+
2. Run `Semantic Release` workflow via `workflow_dispatch`.
119+
3. If no releasable commit exists, workflow will report no new release.
120+
98121
Required repository secrets:
99122
- `PYPI_API_TOKEN`: token used by publish job to upload wheels/sdist to PyPI.

0 commit comments

Comments
 (0)