@@ -23,20 +23,17 @@ jobs:
2323 with :
2424 node-version : 22
2525 cache : npm
26- registry-url : " https://registry.npmjs.org"
2726 - run : npm ci
2827 - run : npm run lint
2928 - run : npm run typecheck
3029 - run : npm test
3130
32- publish :
31+ changesets :
3332 needs : check
3433 runs-on : ubuntu-latest
3534 permissions :
3635 contents : write
37- id-token : write
3836 pull-requests : write
39- issues : read
4037 steps :
4138 - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4239 with :
@@ -45,17 +42,65 @@ jobs:
4542 with :
4643 node-version : 22
4744 cache : npm
48- registry-url : " https://registry.npmjs.org"
49- # Ensure npm 11.5.1 or later is installed for OIDC authentication.
50- - name : Update npm
51- run : npm install -g npm@latest
5245 - name : Install dependencies
5346 run : npm ci
54- - name : Create Release Pull Request or Publish to npm
47+ - name : Create release pull request or GitHub release
5548 id : changesets
5649 uses : changesets/action@e0145edc7d9d8679003495b11f87bd8ef63c0cba # v1.5.3
5750 with :
58- version : npm run bump
59- publish : npm run release
51+ publish : echo 0
6052 env :
6153 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
54+
55+ build :
56+ needs : changesets
57+ if : needs.release.outputs.published == 'true'
58+ runs-on : ubuntu-latest
59+ permissions :
60+ contents : read
61+ steps :
62+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
63+ with :
64+ persist-credentials : false
65+ - uses : actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
66+ with :
67+ node-version : 22
68+ cache : npm
69+ - name : Install dependencies
70+ run : npm ci
71+ - name : Build package
72+ run : npm run build
73+ - name : Upload build artifact
74+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
75+ with :
76+ name : package-build
77+ path : dist/
78+
79+ publish :
80+ environment : publish
81+ needs :
82+ - changesets
83+ - build
84+ if : needs.release.outputs.published == 'true'
85+ runs-on : ubuntu-latest
86+ permissions :
87+ contents : read
88+ id-token : write
89+ steps :
90+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
91+ with :
92+ persist-credentials : false
93+ - uses : actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
94+ with :
95+ node-version : 22
96+ cache : npm
97+ # Ensure npm 11.5.1 or later is installed for OIDC authentication.
98+ - name : Update npm
99+ run : npm install -g npm@latest
100+ - name : Download build artifact
101+ uses : actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
102+ with :
103+ name : package-build
104+ path : ./dist
105+ - name : Publish to npm
106+ run : npm publish
0 commit comments