-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ci): 跨平台自动构建流水线 #6
Conversation
* feat: add cross-platform ci * chore: use dotnet instead of msbuild * feat: use dotnot instead of msbuild for windows * fix: tidy comments * feat: build release only * feat: dotnet publish * feat: specify runtime * fix: file permission loss caused by zip archive so let's use .tar.gz for linux / macos * fix: upload release artifact run case
to prevent accidentally create incomplete releases
because it's not fully cross-platform for now. We believe in the future.
的确现在用到的NAudio库中的某些功能只能在Windows上运行。 |
是正常的,这个 prepare release 是在打 tag 时候创建 release draft 使用的,在一般的 commit 构建时候不会运行到它。 |
好的 |
看起来像是 softprops/action-gh-release#232 这个问题 或许可以尝试检查一下 Workflow permissions 这个是否为 如果是正确的话可以尝试将 issue 里面提到的 job 权限配置添加进 |
感谢,我将权限设置改成Read and write后成功了,他好像自动就发布release了(因为我之前就用这个tag手动发过这个release了,所以表现是帮我替换了包文件) |
改进
存在的问题
winmm
相关的动态链接库,不确定是 NAudio 的跨平台兼容问题还是 TuneLab.csproj 里提到的 TFM 问题(手上的 mac 试了试修改 TargetFramework , dotnet SDK 默认使用的脚本路径不是 Xcode 的应用路径所以报找不到脚本的错误,不确定应该怎么调整并且不想在 mac 上装 VS 就没有深入研究下去),因此这两个平台只会在一般的流水线里构建出来,但不会在 tag 发布时候引入(什么时候问题解决了就可以删掉被注释掉的那一行来上传这两个平台的构建结果了)。注意事项
因为改了构建主逻辑(从 msbuild 改成了 dotnet publish ),所以需要再仔细确认一下 Windows 平台下的构建发布是否依旧功能完备,正常运行。(这边放到 Windows Sandbox 里面装好 dotnet 运行环境后能启动)
补充
虽然现在 macOS 和 Linux 的流水线步骤都是一样的,但未来针对不同的平台可能引入不同的改动(例如 macOS 打包成 App , Linux 打包成 AppImage 这种),所以还是把它们拆开了。