Skip to content

Commit 3306b13

Browse files
committed
Check package.json files up-to-date before publish
1 parent f734f0c commit 3306b13

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.github/workflows/build.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,25 @@ jobs:
5151
- name: Lint Rust code
5252
run: cargo clippy
5353

54+
check-package-json-files:
55+
name: Check package.json files
56+
runs-on: ubuntu-latest
57+
steps:
58+
- uses: actions/checkout@v4
59+
- name: Setup node
60+
uses: actions/setup-node@v4
61+
with:
62+
node-version: 22
63+
cache: npm
64+
- name: Install dependencies
65+
run: npm ci
66+
- name: Update package.json files
67+
run: npm run build:package
68+
- name: Ensure there are no uncommitted changes
69+
run: |
70+
git status --porcelain
71+
test -z "$(git status --porcelain)"
72+
5473
build:
5574
name: Build ${{ matrix.settings.target }} with node@22
5675
runs-on: ${{ matrix.settings.host }}
@@ -313,6 +332,7 @@ jobs:
313332
runs-on: ubuntu-latest
314333
needs:
315334
- lint
335+
- check-package-json-files
316336
- test-macos-binding
317337
- test-linux-x64-gnu-binding
318338
# - test-linux-x64-musl-binding
@@ -336,6 +356,10 @@ jobs:
336356
- name: List packages
337357
run: ls -R ./npm
338358
shell: bash
359+
- name: Ensure there are no uncommitted changes
360+
run: |
361+
git status --porcelain
362+
test -z "$(git status --porcelain)"
339363
- name: Publish
340364
if: ${{ startsWith(github.ref, 'refs/tags/') }}
341365
run: |

0 commit comments

Comments
 (0)