File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 push :
55 branches :
66 - master
7- release :
8- types : [ published ]
97 pull_request :
108 branches :
119 - ' **'
10+ workflow_call :
1211
1312env :
1413 PRIMARY_NODE_VERSION : 24.x
7877 - name : Run unit tests
7978 if : " !(matrix.node-version == env.PRIMARY_NODE_VERSION && matrix.os == env.PRIMARY_OS)"
8079 run : yarn test:unit
81-
82- publish_version :
83- name : Publish
84- runs-on : ${{ matrix.os }}
85- strategy :
86- matrix :
87- os : [ ubuntu-latest ]
88- node-version : [ 24.x ]
89- needs : [ test ]
90- if : github.event_name == 'release' && github.event.action == 'published'
91- steps :
92-
93- - name : Checkout
94- uses : actions/checkout@v5
95-
96- - name : fetch
97- run : |
98- git fetch --prune --unshallow
99-
100- - name : Use Node.js ${{ matrix.node-version }}
101- uses : actions/setup-node@v6
102- with :
103- node-version : ${{ matrix.node-version }}
104- registry-url : ${{ env.REGISTRY }}
105-
106- - name : Get yarn cache directory
107- id : yarn-cache-dir
108- run : |
109- echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
110-
111- - uses : actions/cache@v4
112- id : yarn-cache
113- with :
114- path : ${{ steps.yarn-cache-dir.outputs.dir }}
115- key : ${{ matrix.os }}-${{ matrix.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }}
116- restore-keys : |
117- ${{ matrix.os }}-${{ matrix.node-version }}-yarn-
118-
119- - name : Install dependencies and build
120- run : |
121- yarn install --ignore-engines
122- yarn build
123-
124- - name : Publish
125- uses : JS-DevTools/npm-publish@v1
126- with :
127- token : ${{ secrets.NPM_AUTH_TOKEN }}
128- registry : ${{ env.REGISTRY }}
Original file line number Diff line number Diff line change 1+ name : Publish
2+
3+ on :
4+ release :
5+ types : [ published ]
6+
7+ permissions :
8+ id-token : write # Required for OIDC authentication
9+ contents : read # Allows checking out the repository contents
10+
11+ env :
12+ REGISTRY : https://registry.npmjs.org/
13+
14+ jobs :
15+ test :
16+ name : Run tests before publish
17+ uses : ./.github/workflows/ci.yml
18+ secrets : inherit
19+
20+ publish_version :
21+ name : Publish to NPM
22+ runs-on : ubuntu-latest
23+ strategy :
24+ matrix :
25+ node-version : [ 24.x ]
26+ needs : [ test ]
27+ steps :
28+
29+ - name : Checkout
30+ uses : actions/checkout@v5
31+
32+ - name : fetch
33+ run : |
34+ git fetch --prune --unshallow
35+
36+ - name : Use Node.js ${{ matrix.node-version }}
37+ uses : actions/setup-node@v6
38+ with :
39+ node-version : ${{ matrix.node-version }}
40+ registry-url : ${{ env.REGISTRY }}
41+
42+ - name : Get yarn cache directory
43+ id : yarn-cache-dir
44+ run : |
45+ echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
46+
47+ - uses : actions/cache@v4
48+ id : yarn-cache
49+ with :
50+ path : ${{ steps.yarn-cache-dir.outputs.dir }}
51+ key : ubuntu-latest-${{ matrix.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }}
52+ restore-keys : |
53+ ubuntu-latest-${{ matrix.node-version }}-yarn-
54+
55+ - name : Install dependencies and build
56+ run : |
57+ yarn install --ignore-engines
58+ yarn build
59+
60+ - name : Install dependencies and build
61+ run : |
62+ yarn install --ignore-engines
63+ yarn publish
You can’t perform that action at this time.
0 commit comments