File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : Publish package to NPM
1+ name : Publish packages to NPM
22
33on :
44 push :
77 workflow_dispatch :
88
99jobs :
10- publish :
11- runs-on : ubuntu-latest
12- steps :
13- - uses : actions/checkout@v4
14- - uses : actions/setup-node@v6
15- with :
16- node-version-file : ' .nvmrc'
17- registry-url : https://registry.npmjs.org/
18- - run : corepack enable
19- - run : yarn
20- - run : yarn lint-test
21- - run : yarn build:all
22- - run : yarn workspace @hawk.so/core npm publish --access=public
23- env :
24- YARN_NPM_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
25- - run : yarn workspace @hawk.so/javascript npm publish --access=public
26- env :
27- YARN_NPM_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
10+ publish-core :
11+ uses : ./.github/workflows/publish-package.yml
12+ with :
13+ workspace : ' @hawk.so/core'
14+ path : packages/core
15+ secrets : inherit
16+
17+ publish-javascript :
18+ uses : ./.github/workflows/publish-package.yml
19+ with :
20+ workspace : ' @hawk.so/javascript'
21+ path : packages/javascript
22+ secrets : inherit
23+
2824 notify :
29- needs : publish
25+ needs : [ publish-core, publish-javascript]
3026 runs-on : ubuntu-latest
3127 steps :
3228 - uses : actions/checkout@v4
Original file line number Diff line number Diff line change 1+ name : Publish package to NPM
2+
3+ on :
4+ workflow_call :
5+ inputs :
6+ workspace :
7+ required : true
8+ type : string
9+ description : ' Yarn workspace name'
10+ path :
11+ required : true
12+ type : string
13+ description : ' Package directory relative to repo root'
14+ secrets :
15+ NPM_TOKEN :
16+ required : true
17+
18+ jobs :
19+ publish :
20+ runs-on : ubuntu-latest
21+ steps :
22+ - uses : actions/checkout@v4
23+ - uses : actions/setup-node@v6
24+ with :
25+ node-version-file : ' .nvmrc'
26+ registry-url : https://registry.npmjs.org/
27+ - run : corepack enable
28+ - run : yarn
29+ - run : yarn lint-test
30+ - run : yarn build:all
31+ - name : Publish ${{ inputs.workspace }}
32+ run : |
33+ VERSION=$(node -p "require('./${{ inputs.path }}/package.json').version")
34+ if npm view "${{ inputs.workspace }}@$VERSION" version &>/dev/null; then
35+ echo "${{ inputs.workspace }}@$VERSION already published, skipping"
36+ else
37+ yarn workspace ${{ inputs.workspace }} npm publish --access=public
38+ fi
39+ env :
40+ YARN_NPM_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
Original file line number Diff line number Diff line change 11{
22 "name" : " @hawk.so/javascript" ,
3- "version" : " 3.3.4 " ,
3+ "version" : " 3.3.5 " ,
44 "description" : " JavaScript errors tracking for Hawk.so" ,
55 "files" : [
66 " dist"
You can’t perform that action at this time.
0 commit comments