Skip to content

Commit 28073eb

Browse files
guoxpengclaude
andcommitted
ci: macOS 构建迁移到 arm64 runner(macos-13 已退役)
- macos-13 Intel runner 已被 GitHub 下线, 任务永远排队 - 改用 macos-latest + WEBSSH_MAC_ARCHS=arm64 规避 arm64 runner 上 x64 DMG hdiutil detach 的已知 electron-builder 问题 - build-mac.mjs 架构改为可配置, 本地 Mac 构建默认仍出双架构 - 附带: mac 构建失败日志上传 + pipefail Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 65a3777 commit 28073eb

2 files changed

Lines changed: 15 additions & 7 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,13 @@ jobs:
3737
name: webssh-win
3838
path: release/webssh-win.zip
3939

40-
# ── macOS(dmg + zip,arm64 / x64)──
41-
# macos-13 is an Intel runner: hdiutil can create both HFS+/APFS DMGs there.
42-
# Newer macos-latest (arm64) runners hit a known electron-builder bug where
43-
# the x64 DMG step fails to `hdiutil detach` the shared /Volumes/WebSSH.
40+
# ── macOS(dmg + zip,arm64)──
41+
# macos-13 (Intel) runners have been retired by GitHub, so build on
42+
# macos-latest (arm64). Cross-building the x64 DMG on Apple Silicon hits a
43+
# known electron-builder `hdiutil detach` failure on /Volumes/WebSSH, so CI
44+
# builds arm64 only (WEBSSH_MAC_ARCHS); local Mac builds still do both.
4445
macos:
45-
runs-on: macos-13
46+
runs-on: macos-latest
4647
steps:
4748
- uses: actions/checkout@v5
4849
- uses: actions/setup-node@v5
@@ -56,6 +57,8 @@ jobs:
5657
env:
5758
# CI has no Apple certificates — never attempt identity discovery.
5859
CSC_IDENTITY_AUTO_DISCOVERY: false
60+
# arm64 only on Apple Silicon runners (see comment above).
61+
WEBSSH_MAC_ARCHS: arm64
5962
run: |
6063
set -o pipefail
6164
npm run desktop:mac 2>&1 | tee mac-build.log

‎win/build-mac.mjs‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,18 @@ try {
8787
process.exit(1);
8888
}
8989

90-
console.log('[2/3] Building macOS app (dmg + zip, arm64 then x64)...');
90+
console.log('[2/3] Building macOS app (dmg + zip, per-arch)...');
91+
// Which architectures to build. Defaults to both; CI on arm64 runners sets
92+
// WEBSSH_MAC_ARCHS=arm64 because cross-building the x64 DMG on Apple Silicon
93+
// hits a known electron-builder `hdiutil detach` failure on /Volumes/WebSSH.
94+
const archs = (process.env.WEBSSH_MAC_ARCHS || 'arm64,x64')
95+
.split(',').map(a => a.trim()).filter(Boolean);
9196
// Build each architecture in a SEPARATE electron-builder invocation. Running a
9297
// single `--mac` for both arm64+x64 sequentially collides on the shared DMG
9398
// volume name (/Volumes/WebSSH), making the second build's `hdiutil detach`
9499
// fail on arm64 CI runners. Splitting per-arch lets each invocation detach its
95100
// own volume cleanly.
96-
for (const arch of ['arm64', 'x64']) {
101+
for (const arch of archs) {
97102
console.log(` [2/3] electron-builder --mac --${arch}...`);
98103
execSync(`npx electron-builder --mac --${arch}`, {
99104
cwd: __dirname, stdio: 'inherit', timeout: 900000,

0 commit comments

Comments
 (0)