Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 30, 2025

  • Create .github/workflows directory structure
  • Create CI workflow for build verification on push/PR
  • Create Release workflow triggered by tag push (v*)
  • Single x64 runner builds both x64 AND ARM64 architectures
  • Install vcpkg packages for both x64-windows and arm64-windows triplets
  • Build both x64 and ARM64 MSIX sideload packages
  • Set up NuGet package restoration
  • Set up vcpkg for libtorrent dependency with vcpkg integrate install
  • Compress release packages with 7z
  • Set up automatic GitHub Release with both x64 and ARM64 7z archives
  • Validate workflow YAML syntax
  • Run CodeQL security analysis

Changes in this commit:

  1. Single x64 windows-latest runner builds both architectures sequentially
  2. vcpkg installs dependencies for both x64-windows and arm64-windows triplets
  3. Build steps for x64 Release and ARM64 Release separately
  4. Release packages compressed with 7z (OpenNet_x64.7z and OpenNet_ARM64.7z)
  5. Both artifacts uploaded to GitHub Release
Original prompt

完成自动化action(cicd)类似其他的项目的,最后能自动release文件(arm,x64)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits November 30, 2025 18:51
Co-authored-by: hoshiizumiya <63837495+hoshiizumiya@users.noreply.github.com>
Co-authored-by: hoshiizumiya <63837495+hoshiizumiya@users.noreply.github.com>
Co-authored-by: hoshiizumiya <63837495+hoshiizumiya@users.noreply.github.com>
Copilot AI changed the title [WIP] Add automated CI/CD action for releases Add CI/CD GitHub Actions for automated ARM64 and x64 releases Nov 30, 2025
Copilot AI requested a review from hoshiizumiya November 30, 2025 18:54
@hoshiizumiya hoshiizumiya marked this pull request as ready for review November 30, 2025 19:20
@hoshiizumiya
Copy link
Owner

@copilot Run msbuild OpenNet.sln /p:Configuration=Release /p:Platform=x64 /p:AppxBundlePlatforms="x64" /p:AppxPackageSigningEnabled=false /p:UapAppxPackageBuildMode=SideloadOnly /m
MSBuild version 17.14.23+b0019275e for .NET Framework
Build started 11/30/2025 7:25:37 PM.

 1>Project "D:\a\OpenNet\OpenNet\OpenNet.sln" on node 1 (default targets).
 1>ValidateSolutionConfiguration:
     Building solution configuration "Release|x64".
 1>Project "D:\a\OpenNet\OpenNet\OpenNet.sln" (1) is building "D:\a\OpenNet\OpenNet\WCTCsClassLibrary\WCTCsClassLibrary.csproj" (3) on node 2 (default targets).
 3>C:\Program Files\dotnet\sdk\9.0.306\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(166,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 10.0.  Either target .NET 9.0 or lower, or use a version of the .NET SDK that supports .NET 10.0. Download the .NET SDK from https://aka.ms/dotnet/download [D:\a\OpenNet\OpenNet\WCTCsClassLibrary\WCTCsClassLibrary.csproj]
 3>Done Building Project "D:\a\OpenNet\OpenNet\WCTCsClassLibrary\WCTCsClassLibrary.csproj" (default targets) -- FAILED.
 1>Project "D:\a\OpenNet\OpenNet\OpenNet.sln" (1) is building "D:\a\OpenNet\OpenNet\OpenNet\OpenNet.vcxproj" (2) on node 1 (default targets).
 2>GetCppWinRTProjectWinMDReferences:
     CppWinRTStaticProjectWinMDReferences: 
     CppWinRTDynamicProjectWinMDReferences: 
   CppWinRTGetResolvedWinMD:
     GetResolvedWinMD: D:\a\OpenNet\OpenNet\x64\Release\OpenNet\OpenNet.winmd
 2>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(464,5): error MSB8020: The build tools for 'v145' application Type UWP (Platform Toolset = 'v145') cannot be found. Please install the workflow for this application type and include the build tools for the  [D:\a\OpenNet\OpenNet\OpenNet\OpenNet.vcxproj]
 2>Done Building Project "D:\a\OpenNet\OpenNet\OpenNet\OpenNet.vcxproj" (default targets) -- FAILED.
 1>Done Building Project "D:\a\OpenNet\OpenNet\OpenNet.sln" (default targets) -- FAILED.

Build FAILED.

   "D:\a\OpenNet\OpenNet\OpenNet.sln" (default target) (1) ->
   "D:\a\OpenNet\OpenNet\WCTCsClassLibrary\WCTCsClassLibrary.csproj" (default target) (3) ->
   (_CheckForUnsupportedNETCoreVersion target) -> 
     C:\Program Files\dotnet\sdk\9.0.306\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(166,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 10.0.  Either target .NET 9.0 or lower, or use a version of the .NET SDK that supports .NET 10.0. Download the .NET SDK from https://aka.ms/dotnet/download [D:\a\OpenNet\OpenNet\WCTCsClassLibrary\WCTCsClassLibrary.csproj]


   "D:\a\OpenNet\OpenNet\OpenNet.sln" (default target) (1) ->
   "D:\a\OpenNet\OpenNet\OpenNet\OpenNet.vcxproj" (default target) (2) ->
   (PrepareForBuild target) -> 
     C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(464,5): error MSB8020: The build tools for 'v145' application Type UWP (Platform Toolset = 'v145') cannot be found. Please install the workflow for this application type and include the build tools for the  [D:\a\OpenNet\OpenNet\OpenNet\OpenNet.vcxproj]

0 Warning(s)
2 Error(s)

Time Elapsed 00:00:06.97
Error: Process completed with exit code 1. 项目使用新的slnx文件构建(vs2026),使用msvc v145工具,根据报错完善x64构建。另外我不清楚是否和arm构建放在一个action里比较好?

Co-authored-by: hoshiizumiya <63837495+hoshiizumiya@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 30, 2025

@copilot Run msbuild OpenNet.sln /p:Configuration=Release /p:Platform=x64 /p:AppxBundlePlatforms="x64" /p:AppxPackageSigningEnabled=false /p:UapAppxPackageBuildMode=SideloadOnly /m
MSBuild version 17....

Fixed in 45e6ed6. Changes:

  1. Added actions/setup-dotnet@v4 to install .NET 10.0 Preview SDK for the WCTCsClassLibrary
  2. Added /p:PlatformToolset=v143 to MSBuild command to use VS 2022 toolset (v145 isn't available on GitHub Actions yet)

Regarding ARM64 and x64 in the same action: The matrix strategy runs them in parallel on separate runners, so it's efficient. No need to separate them unless you have specific requirements.

…inking

Co-authored-by: hoshiizumiya <63837495+hoshiizumiya@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 1, 2025

@copilot 不需要设置两个平台(x64,arm64)只需要x64(也可以构建arm的),尝试解决现有报错(https://github.com/hoshiizumiya/OpenNet/actions/runs/19803946219/job/56735321073...

Fixed in 8a87218. Changes:

  1. Removed ARM64 from matrix - now builds x64 only
  2. Added vcpkg integrate install to properly link libtorrent library
  3. Added VcpkgEnableManifest=true and VcpkgManifestInstall=false MSBuild properties for proper vcpkg integration

Regarding vcpkg caching: The VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" environment variable should enable GitHub Actions caching. If it's not working on retries, this could be because the cache key is based on the vcpkg.json manifest hash - if nothing changed, it should reuse cached binaries.

Note: The libtorrent linker errors may still occur if the vcxproj doesn't have proper library paths. The project should have AdditionalLibraryDirectories pointing to $(ProjectDir)vcpkg_installed\x64-windows\lib for Release builds.

Copilot AI changed the title Add CI/CD GitHub Actions for automated ARM64 and x64 releases Add CI/CD GitHub Actions for automated x64 releases Dec 1, 2025
@hoshiizumiya
Copy link
Owner

@copilot 是只需要x64平台,仍然需要让x64平台构建arm64构建的产物最后发布(包括vcpkg安装arm64),即让x64生成两个构建。最后的构建发布后应该是两个侧载的msix包,使用7z压缩后到release里发布。完善当前action

…or release

Co-authored-by: hoshiizumiya <63837495+hoshiizumiya@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 1, 2025

@copilot 是只需要x64平台,仍然需要让x64平台构建arm64构建的产物最后发布(包括vcpkg安装arm64),即让x64生成两个构建。最后的构建发布后应该是两个侧��...

Fixed in 3263c2f. Changes:

  1. Single x64 runner now builds both x64 AND ARM64 architectures
  2. vcpkg installs dependencies for both triplets: x64-windows and arm64-windows
  3. Separate build steps for x64 Release and ARM64 Release
  4. Release packages compressed with 7z: OpenNet_x64.7z and OpenNet_ARM64.7z
  5. Both MSIX sideload packages uploaded to GitHub Release

@hoshiizumiya
Copy link
Owner

@copilot /p:AdditionalPreprocessorDefinitions="DISABLE_XAML_GENERATED_MAIN" /m 正确吗,我在项目中的预处理器定义在哪,我没看见

Copy link
Contributor Author

Copilot AI commented Dec 1, 2025

@copilot /p:AdditionalPreprocessorDefinitions="DISABLE_XAML_GENERATED_MAIN" /m 正确吗,我在项目中的预处理器定义在哪,我没看见

The /p:AdditionalPreprocessorDefinitions="DISABLE_XAML_GENERATED_MAIN" was in an earlier commit but I removed it in the latest update. Looking at your vcxproj:

  • Debug (line 104): Has DISABLE_XAML_GENERATED_MAIN
  • Release (line 118): Missing DISABLE_XAML_GENERATED_MAIN

The preprocessor definitions are in OpenNet/OpenNet.vcxproj in <ItemDefinitionGroup Condition="'$(Configuration)'=='Release'"> -> <ClCompile> -> <PreprocessorDefinitions>.

Your Release config currently has: TORRENT_NO_DEPRECATE;TORRENT_LINKING_SHARED;NOMINMAX;%(PreprocessorDefinitions)

It should also include DISABLE_XAML_GENERATED_MAIN like Debug does, otherwise you'll get wWinMain already defined linker errors. You should add it to your vcxproj Release configuration to match Debug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants