Skip to content

Commit 394b252

Browse files
committed
ci: npm publish workflow
1 parent 31f67be commit 394b252

5 files changed

Lines changed: 57 additions & 2 deletions

File tree

.github/workflows/docs.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@ jobs:
2828
- uses: actions/setup-node@v4
2929
with:
3030
node-version: 20
31-
cache: pnpm
3231

33-
- run: pnpm install --frozen-lockfile
32+
- run: pnpm install
3433

3534
- name: Build docs
3635
working-directory: apps/docs

.github/workflows/publish.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish Packages
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
id-token: write
11+
12+
jobs:
13+
publish:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: pnpm/action-setup@v4
19+
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: 20
23+
registry-url: https://registry.npmjs.org
24+
25+
- run: pnpm install
26+
27+
- run: pnpm turbo build --filter="./packages/*"
28+
29+
- run: pnpm turbo test --filter="./packages/*"
30+
31+
- name: Publish @react-volatile/core
32+
working-directory: packages/core
33+
run: pnpm publish --no-git-checks
34+
env:
35+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
36+
37+
- name: Publish @react-volatile/react
38+
working-directory: packages/react
39+
run: pnpm publish --no-git-checks
40+
env:
41+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
42+
43+
- name: Publish @react-volatile/babel-plugin
44+
working-directory: packages/babel-plugin
45+
run: pnpm publish --no-git-checks
46+
env:
47+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

packages/babel-plugin/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
"types": "./dist/index.d.ts"
1313
}
1414
},
15+
"publishConfig": {
16+
"access": "public"
17+
},
1518
"scripts": {
1619
"build": "tsup",
1720
"dev": "tsup --watch",

packages/core/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
}
1414
},
1515
"sideEffects": false,
16+
"publishConfig": {
17+
"access": "public"
18+
},
1619
"scripts": {
1720
"build": "tsup",
1821
"dev": "tsup --watch",

packages/react/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
}
1414
},
1515
"sideEffects": false,
16+
"publishConfig": {
17+
"access": "public"
18+
},
1619
"scripts": {
1720
"build": "tsup",
1821
"dev": "tsup --watch",

0 commit comments

Comments
 (0)