mirror of https://github.com/ospab/ostp.git
fix(ci): staging script was CommonJS in an ES-module package
ostp-gui/package.json sets "type": "module", so a .js file is loaded as an ES module and `require` is not defined — the installer build died on the first line of stage-sidecar.js. Renamed to .cjs, which opts that one file back into CommonJS. The failure was also reported in the wrong place. pwsh does not abort a run block when a native command exits non-zero, so the build carried on past the dead script and failed several steps later complaining about a sidecar that nothing had staged. The two commands are chained now, so staging failures surface as themselves. Verified locally this time: the script resolves the host triple, copies the helper to the name Tauri expects, and warns about a missing wintun.dll rather than failing silently.
This commit is contained in:
parent
96d6bb61d2
commit
b18de0379c
|
|
@ -426,9 +426,10 @@ jobs:
|
||||||
# first, and fail the build script when it is not.
|
# first, and fail the build script when it is not.
|
||||||
- name: Build NSIS Installer
|
- name: Build NSIS Installer
|
||||||
working-directory: ostp-gui
|
working-directory: ostp-gui
|
||||||
run: |
|
# Chained, not two lines: pwsh does not abort a run block when a native
|
||||||
node stage-sidecar.js --release --target ${{ matrix.target }}
|
# command fails, so a staging failure would otherwise be reported far
|
||||||
npx tauri build --bundles nsis --target ${{ matrix.target }} --config src-tauri/tauri.installer.conf.json
|
# downstream as a missing sidecar rather than as itself.
|
||||||
|
run: node stage-sidecar.cjs --release --target ${{ matrix.target }} && npx tauri build --bundles nsis --target ${{ matrix.target }} --config src-tauri/tauri.installer.conf.json
|
||||||
|
|
||||||
- name: Collect installer
|
- name: Collect installer
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,9 @@
|
||||||
"tauri": "tauri",
|
"tauri": "tauri",
|
||||||
"dev": "cargo build -p ostp-tun-helper && npx tauri dev",
|
"dev": "cargo build -p ostp-tun-helper && npx tauri dev",
|
||||||
"build": "cargo build -p ostp-tun-helper --release && npx tauri build --no-bundle",
|
"build": "cargo build -p ostp-tun-helper --release && npx tauri build --no-bundle",
|
||||||
"build:installer": "cargo build -p ostp-tun-helper --release && node stage-sidecar.js --release && npx tauri build --bundles nsis --config src-tauri/tauri.installer.conf.json",
|
"build:installer": "cargo build -p ostp-tun-helper --release && node stage-sidecar.cjs --release && npx tauri build --bundles nsis --config src-tauri/tauri.installer.conf.json",
|
||||||
"build:dist": "npm run build && node build_dist.js",
|
"build:dist": "npm run build && node build_dist.js",
|
||||||
"sidecar": "node stage-sidecar.js"
|
"sidecar": "node stage-sidecar.cjs"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tauri-apps/cli": "^2"
|
"@tauri-apps/cli": "^2"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue