Skip to content

Commit 68281a8

Browse files
committed
Add GitHub Actions CI and npm publish workflows
CI runs lint, format check, type check, and tests on PRs and pushes to main. Publish workflow builds and publishes to npm via OIDC trusted publishing on v* tag pushes. Added publishConfig to package.json for provenance and public access defaults.
1 parent 95367fb commit 68281a8

3 files changed

Lines changed: 55 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
permissions: {}
9+
10+
jobs:
11+
quality:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: 22
18+
cache: npm
19+
- run: npm ci
20+
- run: npx playwright install chromium --with-deps
21+
- run: npm run lint
22+
- run: npm run fmt:check
23+
- run: npm run check
24+
- run: npm test

.github/workflows/publish.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags: ["v*"]
6+
7+
permissions:
8+
contents: read
9+
id-token: write
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: 22
19+
registry-url: "https://registry.npmjs.org"
20+
- run: npm ci
21+
- run: npx playwright install chromium --with-deps
22+
- run: npm run lint
23+
- run: npm run fmt:check
24+
- run: npm run check
25+
- run: npm test
26+
- run: npm run build
27+
- run: npm publish --provenance --access public

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,9 @@
7272
"peerDependencies": {
7373
"@sveltejs/kit": "^2.0.0",
7474
"svelte": "^5.0.0"
75+
},
76+
"publishConfig": {
77+
"provenance": true,
78+
"access": "public"
7579
}
7680
}

0 commit comments

Comments
 (0)