Skip to content

Commit 0171dcf

Browse files
committed
fix(ci): gate release on CI success
Move release into ci.yml as a job with `needs: check` so semantic-release only runs after all checks pass. Removes duplicated test/check steps from the release job.
1 parent abaee33 commit 0171dcf

3 files changed

Lines changed: 20 additions & 27 deletions

File tree

β€Ž.github/workflows/ci.ymlβ€Ž

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,22 @@ jobs:
2323
- run: pnpm run build:dist
2424
- run: pnpm run lint:publint
2525
- run: pnpm exec tsc --noEmit
26+
27+
release:
28+
if: github.ref == 'refs/heads/main'
29+
needs: check
30+
runs-on: ubuntu-latest
31+
permissions:
32+
contents: write
33+
issues: write
34+
pull-requests: write
35+
id-token: write
36+
steps:
37+
- uses: actions/checkout@v4
38+
with:
39+
fetch-depth: 0
40+
- uses: jdx/mise-action@v3
41+
- run: pnpm install
42+
- run: npx semantic-release
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

β€Ž.github/workflows/release.ymlβ€Ž

Lines changed: 0 additions & 26 deletions
This file was deleted.

β€ŽAGENTS.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Commits must follow [Conventional Commits](https://www.conventionalcommits.org/)
7272
- Transpiles to JS via tsdown: `bin` β†’ `dist/cli.mjs`, `exports` β†’ `dist/*.mjs` + `dist/*.d.mts`
7373
- `files` array controls what's published: `dist/`, `styles/`, `src/pwa/icons/`, `README.md`, `CHANGELOG.md`, `LICENSE`
7474
- CI: `.github/workflows/ci.yml` β€” pnpm test + biome check
75-
- Release: `.github/workflows/release.yml` β€” semantic-release on push to main
75+
- Release: `release` job in `.github/workflows/ci.yml` β€” semantic-release on push to main, gated on `check` job
7676
- Versioning, changelog, npm publish, and GitHub Release are all automated
7777
- `npx semantic-release --dry-run` for local verification
7878
- Release triggers: `feat:` β†’ minor, `fix:` β†’ patch, `BREAKING CHANGE` β†’ major

0 commit comments

Comments
Β (0)