File tree Expand file tree Collapse file tree 2 files changed +55
-49
lines changed
Expand file tree Collapse file tree 2 files changed +55
-49
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ name : Publish to both GitHub & npm
2+
3+ on :
4+ push :
5+ tags :
6+ - " v*"
7+ workflow_dispatch :
8+
9+ jobs :
10+ publish :
11+ runs-on : ubuntu-latest
12+
13+ strategy :
14+ matrix :
15+ registry : [github, npm]
16+
17+ steps :
18+ - name : Checkout
19+ uses : actions/checkout@v4
20+
21+ - name : Setup Node
22+ uses : actions/setup-node@v4
23+ with :
24+ node-version : 18
25+ registry-url : ${{ matrix.registry == 'github' && 'https://npm.pkg.github.com' || 'https://registry.npmjs.org' }}
26+ scope : " @sr2echa"
27+
28+ - name : Setup pnpm
29+ uses : pnpm/action-setup@v2
30+ with :
31+ version : latest
32+
33+ - name : Install deps
34+ run : |
35+ cd client
36+ pnpm install
37+
38+ - name : Adjust package name for npmjs (only)
39+ if : matrix.registry == 'npm'
40+ run : |
41+ cd client
42+ jq '.name = "interwu" | .publishConfig.registry = "https://registry.npmjs.org/"' package.json > tmp && mv tmp package.json
43+
44+ - name : Build and Test
45+ run : |
46+ cd client
47+ pnpm test --if-present
48+ npm pack
49+
50+ - name : Publish
51+ run : |
52+ cd client
53+ npm publish --access public
54+ env :
55+ NODE_AUTH_TOKEN : ${{ matrix.registry == 'github' && secrets.GH_NPM_TOKEN || secrets.NPM_TOKEN }}
You can’t perform that action at this time.
0 commit comments