Skip to content

Commit 2b6cfd5

Browse files
committedAug 24, 2024·
GH Actions: fix deployment of @next versions in /devel
The change in 03de7ce actually didn't have any effect on the `out/` directory because `lib/_npm/` was last updated by `npm ci` (because `node vendor_build.js` is registered as an `install` script) when `package-lock.json` still contained the old versions.
1 parent 0a3ba86 commit 2b6cfd5

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed
 

‎.github/workflows/main.yml

+12-9
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,20 @@ jobs:
3535
- uses: actions/setup-node@v4
3636
with:
3737
node-version: '20'
38-
- run: npm ci
3938

40-
- name: Use stable versions of KSC and JS runtime
41-
run: |
42-
npm install kaitai-struct-compiler@latest kaitai-struct@latest
43-
node vendor_build.js
44-
if: github.ref == 'refs/heads/stable'
45-
- name: Use devel versions of KSC and JS runtime
39+
- name: Use appropriate versions of KSC and JS runtime
40+
env:
41+
DIST_TAG: ${{ github.ref == 'refs/heads/master' && 'next' || 'latest' }}
42+
# `--package-lock-only` means that it only updates `package-lock.json`
43+
# (and `package.json`) without touching `node_modules/` at all.
4644
run: |
47-
npm update kaitai-struct-compiler kaitai-struct
48-
if: github.ref == 'refs/heads/master'
45+
npm install --package-lock-only kaitai-struct-compiler@"$DIST_TAG" kaitai-struct@"$DIST_TAG"
46+
47+
# NOTE: it's important that `npm ci` is run *after* the adjustment of
48+
# KSC's and JS runtime's versions so that the `install` script (`node
49+
# vendor_build.js`) copies the correct versions into the `lib/_npm/`
50+
# folder which will be deployed.
51+
- run: npm ci
4952

5053
- name: Set up environment variables for stable deployment
5154
run: |

0 commit comments

Comments
 (0)
Please sign in to comment.