diff options
| author | haoyuren <13851610112@163.com> | 2026-07-30 10:59:30 +0800 |
|---|---|---|
| committer | haoyuren <13851610112@163.com> | 2026-07-30 10:59:30 +0800 |
| commit | d09de8c873d4d7092e94b354b3457ef496da5cef (patch) | |
| tree | 9843661a592badcbdc62af03196e447c7180ffee /.github | |
| parent | 429d737f940a52ca4124f13f5911e6759d4b63bb (diff) | |
Windows CI: explicit verbose node-pty rebuild instead of install-app-deps
@electron/rebuild swallows child-process output and hung indefinitely at
"preparing node-pty" on both windows-latest and windows-2022 images.
Skip lifecycle scripts during npm ci and rebuild node-pty for Electron
directly via node-gyp (verbose, 10-minute step timeout), then package
with npmRebuild=false.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/release-windows.yml | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/.github/workflows/release-windows.yml b/.github/workflows/release-windows.yml index 02d3071..2160182 100644 --- a/.github/workflows/release-windows.yml +++ b/.github/workflows/release-windows.yml @@ -29,16 +29,34 @@ jobs: with: node-version: 20 - # node-gyp is pinned to ^11 via package.json "overrides" — the v9 the - # tree would otherwise hoist cannot detect VS2022 on current runners - # (and @electron/rebuild requires the in-tree node-gyp directly). - - name: Install dependencies - run: npm ci + # Lifecycle scripts are skipped: electron-builder's install-app-deps + # (our postinstall) rebuilds node-pty through @electron/rebuild, which + # swallows child output and has hung indefinitely on Windows runners. + # The rebuild is done as an explicit, verbose, time-boxed step instead. + - name: Install dependencies (skip lifecycle scripts) + run: npm ci --ignore-scripts + + - name: Install esbuild platform binary + run: npm rebuild esbuild - name: Build run: npm run build + - name: Detect Electron version + shell: pwsh + run: | + "ELECTRON_VERSION=$(node -p `"require('electron/package.json').version`")" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 + + - name: Rebuild node-pty for Electron (verbose) + working-directory: node_modules/node-pty + timeout-minutes: 10 + shell: pwsh + run: | + npx node-gyp rebuild --target=$env:ELECTRON_VERSION --arch=x64 --dist-url=https://electronjs.org/headers --loglevel=verbose + + # npmRebuild=false: node-pty is already rebuilt for Electron above — + # don't let electron-builder run its opaque rebuild again. - name: Package and publish Windows installer - run: npx electron-builder --win --publish always + run: npx electron-builder --win -c.npmRebuild=false --publish always env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
