44
44
id : cache-node-modules
45
45
uses : actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
46
46
with :
47
- key : node-modules-dev-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package.json') }}
47
+ key : node-modules-dev-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package-lock .json') }}
48
48
path : |
49
49
node_modules
50
50
- name : Install debug NPM packages
@@ -102,9 +102,6 @@ jobs:
102
102
runs-on : ubuntu-24.04
103
103
needs :
104
104
- meta
105
- permissions :
106
- id-token : write
107
- attestations : write
108
105
strategy :
109
106
matrix :
110
107
rust-version :
@@ -133,33 +130,24 @@ jobs:
133
130
- name : Cache npm install
134
131
uses : actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
135
132
with :
136
- key : node-modules-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package.json') }}
133
+ key : node-modules-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package-lock .json') }}
137
134
path : |
138
135
node_modules
139
136
140
137
- name : Install NPM packages
141
138
run : |
142
139
npm install
143
140
144
- - name : Perform release build
145
- run : |
146
- npm run build:release
147
-
148
141
- name : Create release package
149
142
working-directory : ${{ needs.meta.outputs.project-dir }}
150
143
run : |
151
144
npm pack
152
145
153
- - uses : actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2.4.0
154
- with :
155
- subject-path : ${{ needs.meta.outputs.artifacts-glob }}
156
-
157
146
- uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
158
147
with :
159
148
if-no-files-found : error
160
- name : componentize-js
161
149
path : |
162
- ${{ needs.meta.outputs.artifacts-glob }}
150
+ ${{ needs.meta.outputs.artifact-name }}
163
151
164
152
test-npm-release :
165
153
runs-on : ubuntu-24.04
@@ -176,22 +164,28 @@ jobs:
176
164
- name : Test built componentize-js NPM package
177
165
shell : bash
178
166
run : |
179
- export PACKAGE_DIR =${{ github.workspace }}/artifacts/componentize-js /${{ needs.meta.outputs.artifact-name }}
167
+ export PACKAGE_FILE_PATH =${{ github.workspace }}/artifacts/artifact /${{ needs.meta.outputs.artifact-name }}
180
168
cp -r examples/hello-world/guest /tmp/test
181
169
cd /tmp/test
182
- npm install --save $PACKAGE_DIR
170
+ npm install --save $PACKAGE_FILE_PATH
183
171
npm run all
184
172
185
173
npm-publish :
186
174
runs-on : ubuntu-24.04
187
175
needs :
188
176
- meta
189
177
- test-npm-release
178
+ permissions :
179
+ id-token : write
190
180
env :
191
181
PREPACK_SKIP_BUILD : " true"
192
182
steps :
193
183
- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
194
184
185
+ - uses : actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
186
+ with :
187
+ node-version : " >=22"
188
+
195
189
- name : Add npmrc
196
190
run : |
197
191
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc
@@ -205,7 +199,7 @@ jobs:
205
199
NPM_TOKEN : ${{ secrets.NPM_ACCESS_TOKEN }}
206
200
shell : bash
207
201
run : |
208
- export PACKAGE_DIR =${{ github.workspace }}/artifacts/componentize-js /${{ needs.meta.outputs.artifact-name }}
202
+ export PACKAGE_FILE_PATH =${{ github.workspace }}/artifacts/artifact /${{ needs.meta.outputs.artifact-name }}
209
203
210
204
export OPT_DRY_RUN="--dry-run"
211
205
if [ "tag" == "${{ github.ref_type }}" ]; then
@@ -217,7 +211,14 @@ jobs:
217
211
export OPT_RELEASE_TAG="--tag ${{ needs.meta.outputs.prerelease-tag }}";
218
212
fi
219
213
220
- npm publish -w @bytecodealliance/componentize-js $OPT_DRY_RUN $OPT_RELEASE_TAG $PACKAGE_DIR --access=public
214
+ npm publish \
215
+ --verbose \
216
+ -w @bytecodealliance/componentize-js \
217
+ --access=public \
218
+ --provenance \
219
+ $OPT_DRY_RUN \
220
+ $OPT_RELEASE_TAG \
221
+ $PACKAGE_FILE_PATH
221
222
222
223
create-gh-release :
223
224
runs-on : ubuntu-24.04
0 commit comments