Skip to content

Commit fb579cc

Browse files
committed
chore: add tag-driven npm publish workflow with provenance
Adds .github/workflows/release.yml, triggered by v* tags (publish) or workflow_dispatch (dry-run rehearsal). Runs the same verify/typecheck/build gate as CI, checks the pushed tag matches the built package version, then publishes dist/packages/convex-angular with npm provenance.
1 parent 5b7558d commit fb579cc

2 files changed

Lines changed: 54 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags: ['v*']
6+
workflow_dispatch: # dry-run rehearsal: runs everything except the publish
7+
8+
permissions:
9+
contents: read
10+
id-token: write # npm provenance
11+
12+
jobs:
13+
publish:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- uses: pnpm/action-setup@v4
21+
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version-file: .nvmrc
25+
cache: pnpm
26+
registry-url: https://registry.npmjs.org
27+
28+
- run: pnpm install --frozen-lockfile
29+
30+
- run: pnpm verify:full
31+
32+
- run: pnpm typecheck:spec
33+
34+
- run: pnpm build:library
35+
36+
# The tag must match the built manifest — a mis-tagged release fails here
37+
# instead of publishing the wrong version.
38+
- name: Check tag matches package version
39+
if: github.event_name == 'push'
40+
run: |
41+
TAG="${GITHUB_REF_NAME#v}"
42+
PKG="$(node -p "require('./dist/packages/convex-angular/package.json').version")"
43+
[ "$TAG" = "$PKG" ] || { echo "tag v$TAG != package $PKG"; exit 1; }
44+
45+
- name: Publish (dry run)
46+
if: github.event_name == 'workflow_dispatch'
47+
run: npm publish dist/packages/convex-angular --dry-run
48+
49+
- name: Publish
50+
if: github.event_name == 'push'
51+
run: npm publish dist/packages/convex-angular --provenance --access public
52+
env:
53+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,4 @@ UI uses Angular Material 3 + SCSS. The theme lives in `src/styles.scss` (`mat.th
105105
- Tests are Jest via `jest-preset-angular`; specs live next to source as `*.spec.ts`. Both projects use the shared `jest.preset.js`.
106106
- Prettier: single quotes, `printWidth` 120, trailing commas. Imports are auto-sorted (`@ianvs/prettier-plugin-sort-imports`): builtins → third-party → `@convex-angular/*` → relative.
107107
- Public API surface is documented with TSDoc `@public`/`@internal` tags; keep new exports annotated and re-exported from `index.ts`.
108-
- Releases use Nx release (`nx.json` `release`), versioned from git tags; the library version lives in `packages/convex-angular/package.json`.
108+
- Releases use Nx release (`nx.json` `release`), versioned from git tags; the library version lives in `packages/convex-angular/package.json`. Pushing a `v*` tag triggers `.github/workflows/release.yml` (verify → build → tag/version consistency check → `npm publish --provenance`); `workflow_dispatch` runs the same pipeline as a dry run.

0 commit comments

Comments
 (0)