Skip to content

Commit

Permalink
GH Actions: fix deployment of @next versions in /devel
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
generalmimon committed Aug 24, 2024
1 parent 0a3ba86 commit 2b6cfd5
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,20 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: npm ci

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

- name: Set up environment variables for stable deployment
run: |
Expand Down

0 comments on commit 2b6cfd5

Please sign in to comment.