Repository navigation
ci: Modify CI procedure to avoid duplicated framework in macOS application & Fix steamapi startup issue on macOS - #676
Merged
Conversation
修复了 macOS 打包时没有保留 .app 内部符号链接,导致 electron framework 被重复打包三次的问题
修复了 unpack 位置配置问题,导致 steam api 没有被解包,从而导致导出的游戏在 macOS 上无法启动的问题。
MakinoharaShoko
approved these changes
Nov 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
macOS 打包构建 WebGAL_Electron_Template 时,由于复制 electron-builder 生成的文件时采用了
cp -r命令,导致 macOS app 内部的符号链接被展开为三份重复的文件,占用了大量的存储空间。本 PR 通过改进打包流程解决了重复存储的问题,并解决了 steam api 解包错误导致导出后游戏无法启动的问题。具体问题
如下三个文件是 electron 自身的框架文件,按照 macOS app 规范,它们应该通过符号链接相连,只占用一份存储空间,大小均为约 314.1MB:
WebGAL_Electron_Template/Contents/Frameworks/Electron Framework.framework/Electron FrameworkWebGAL_Electron_Template/Contents/Frameworks/Electron Framework.framework/Versions/Current/Electron FrameworkWebGAL_Electron_Template/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework不过,由于复制时破坏了符号链接,它们占用了三份空间,最终导致整个程序大小达到了约 1.41 GB。
关于 Steam api:在 macOS 上,由于 Electron 自身的 asar 库在打包时无法识别 .webgal_terre 这样的点开头隐藏目录,
libsteam_api.dylib没有正确的被放到 ASAR 的外部,从而导致启动时程序无法找到该库,无法启动任何导出的游戏。修复方式
cp -r命令改为保留符号链接的cp -R -P -pditto代替7z以保护压缩包中的符号链接。ditto同样是 GitHub Action 环境下的可用 ma cOS 命令。verbatimSymlinks: true,从而保护导出游戏内部 electron 框架的符号链接。效果
macOS universal 安装压缩包的体积从约 547MB 减少到约 243MB,解压后程序占用空间从 1.41GB 减少到约 575MB (约减少 59%)。
默认模版(WebGal 2026 Refine)创建的游戏导出后体积从 785MB 减少到约 448MB(约减少 45%)。
测试
我补充了一些额外的测试,来检测复制后符号链接是否仍然能保持,以及检查 steam api 解包路径修改是否正确。此外,我测试了修改后的新版本,编辑器可以正常运行,导出的 WebGal 游戏也可以正常运行。
AI 使用情况
GPT-6.1 Sol 协助完成了问题的定位和修复,我进行了审查和实际运行测试。commit message 与此 PR 的内容是我自己编写的。
其他
我主要使用 Mac,对自己的开源项目也设计过不少 macOS 打包的流程。如果需要,我很乐意对目前的打包再做一些优化,例如: