Skip to content

Commit 9b6badd

Browse files
committed
ci: add github actions workflows
- Add CI checks for every push and pull request, running typecheck and lint with pnpm. - Add release publishing workflow that installs dependencies, verifies the package, builds it, and publishes to npm after a GitHub Release is published.
1 parent 002cf9b commit 9b6badd

3 files changed

Lines changed: 70 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
check:
12+
name: Typecheck and lint
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
- name: Setup pnpm
18+
uses: pnpm/action-setup@v4
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 24
23+
cache: pnpm
24+
- name: Install dependencies
25+
run: pnpm install --frozen-lockfile
26+
- name: Typecheck
27+
run: pnpm typecheck
28+
- name: Lint
29+
run: pnpm lint

.github/workflows/publish.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
permissions:
9+
contents: read
10+
id-token: write
11+
12+
jobs:
13+
publish:
14+
name: Build and publish
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
- name: Setup pnpm
21+
uses: pnpm/action-setup@v4
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 24
26+
cache: pnpm
27+
registry-url: https://registry.npmjs.org
28+
- name: Install dependencies
29+
run: pnpm install --frozen-lockfile
30+
- name: Typecheck
31+
run: pnpm typecheck
32+
- name: Lint
33+
run: pnpm lint
34+
- name: Build
35+
run: pnpm build
36+
- name: Publish to npm
37+
run: npm publish --access public

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
"name": "react-map-gl-supercluster",
33
"version": "3.0.0",
44
"license": "MIT",
5+
"repository": {
6+
"type": "git",
7+
"url": "git+https://github.com/khmm12/react-map-gl-supercluster.git"
8+
},
59
"sideEffects": false,
610
"type": "module",
711
"exports": {

0 commit comments

Comments
 (0)