@samitouri / QOSami-HFS / commits / 54cd7d8b

dx: keep github workflow and package.json aligned

Massimo Melina committed Mar 5, 2026 at 17:39 UTC 54cd7d8b06dc9c37c29cc980f4131925a1cf3ffd
2 files changed +19 -5
.github/workflows/release-assets.yml
+18 -2
@@ -30,10 +30,26 @@ jobs:
30 - name: Checkout
31 uses: actions/checkout@v4
32
33 + - name: Resolve Windows pkg target
34 + id: pkg_target
35 + shell: pwsh
36 + run: |
37 + # keep workflow and package.json aligned by deriving the Windows pkg target from a single source of truth
38 + $pkg = Get-Content package.json -Raw | ConvertFrom-Json
39 + $target = @($pkg.pkg.targets) | Where-Object { $_ -match '-win-x64$' } | Select-Object -First 1
40 + if (-not $target) {
41 + throw "No Windows pkg target (-win-x64) found in package.json"
42 + }
43 + if ($target -notmatch '^node(\d+)-') {
44 + throw "Unsupported pkg target format: $target"
45 + }
46 + "target=$target" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
47 + "node_major=$($matches[1])" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
48 +
49 - name: Setup Node
50 uses: actions/setup-node@v4
51 with:
36 - node-version: ${{ env.NODE_VERSION }}
52 + node-version: ${{ steps.pkg_target.outputs.node_major }}
53 cache: npm
54
55 - name: Install dependencies
@@ -51,7 +67,7 @@ jobs:
67 - name: Build Windows binary
68 run: |
69 cd dist
54 - npx pkg . --public -C gzip -t node${{ env.NODE_VERSION }}-win-x64
70 + npx pkg . --public -C gzip -t ${{ steps.pkg_target.outputs.target }}
71 npx resedit-cli --in hfs.exe --icon 1,../hfs.ico --out hfs.exe
72
73 - name: Prepare unsigned artifact folder
dev.md
+1 -3
@@ -8,8 +8,6 @@ This file is mostly aimed to developers.
8
9 At this stage you have a javascript output. For binary files you'll also have to `npm run dist-bin`.
10
11 -You could instead run `npm run dist` to run both *build-all* & *dist-bin*.
12 -
11 ## Troubleshooting
12
13 - If you get error "Rollup failed to resolve import "@mui/icons-material/..."
@@ -28,7 +26,7 @@ been built, so their files are available in `dist` folder.
26 To run tests
27 - `npm run build-all`
28 - `npm run test-with-server` (backend tests)
31 -- `npx playwright test` (these are UI tests)
29 +- `npx playwright test` (UI tests)
30
31 # File organization
32