1+ name : windows build workflows
2+
3+ on :
4+ push :
5+ branches : [ "develop" ]
6+ pull_request :
7+ branches : [ "develop" ]
8+
9+ permissions :
10+ contents : read
11+
12+ jobs :
13+ build :
14+ strategy :
15+ # Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
16+ fail-fast : false
17+ matrix :
18+ configuration : [Debug ,Release]
19+ platform : [x86 ,x64]
20+
21+ runs-on : windows-latest # 最新的 Windows 环境
22+
23+ steps :
24+ # 检出您的主仓库代码
25+ - name : Checkout main repository code
26+ uses : actions/checkout@v4
27+ with :
28+ ref : ' develop'
29+
30+ # 检出依赖的xengine仓库到指定的xengine目录
31+ - name : Checkout dependency repository (xengine)
32+ uses : actions/checkout@v4
33+ with :
34+ repository : libxengine/libxengine
35+ path : libxengine
36+
37+ - name : sub module checkout (opensource)
38+ run : |
39+ git submodule init
40+ git submodule update
41+ shell : pwsh
42+
43+ - name : vcpkg dependency repository
44+ uses : actions/checkout@v4
45+ with :
46+ repository : microsoft/vcpkg
47+ path : vcpkg
48+
49+ - name : vcpkg install (x86)
50+ if : matrix.platform == 'x86'
51+ run : |
52+ cd vcpkg
53+ ./bootstrap-vcpkg.bat
54+ ./vcpkg.exe install libsrt:x86-windows libsrtp:x86-windows
55+ ./vcpkg.exe integrate install
56+ shell : pwsh
57+ - name : vcpkg install (x64)
58+ if : matrix.platform == 'x64'
59+ run : |
60+ cd vcpkg
61+ ./bootstrap-vcpkg.bat
62+ ./vcpkg.exe install libsrt:x64-windows libsrtp:x64-windows
63+ ./vcpkg.exe integrate install
64+ shell : pwsh
65+
66+ # 设置依赖库的环境变量
67+ - name : Set up Dependency Environment Variables
68+ run : |
69+ echo "XENGINE_INCLUDE=${{ github.workspace }}/libxengine" | Out-File -FilePath $env:GITHUB_ENV -Append
70+ echo "XENGINE_LIB32=${{ github.workspace }}/libxengine/XEngine_Windows/x86" | Out-File -FilePath $env:GITHUB_ENV -Append
71+ echo "XENGINE_LIB64=${{ github.workspace }}/libxengine/XEngine_Windows/x64" | Out-File -FilePath $env:GITHUB_ENV -Append
72+ shell : pwsh
73+
74+ # 配置 MSBuild 的路径,准备构建 VC++ 项目
75+ - name : Setup MSBuild
76+ uses : microsoft/setup-msbuild@v2
77+ # 编译
78+ - name : Build Solution
79+ run : msbuild XEngine_Source/XEngine.sln /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }}
80+ # 测试
81+ - name : Conditional Step for x86 Release
82+ if : matrix.configuration == 'Release' && matrix.platform == 'x86'
83+ run : |
84+ cp -r XEngine_Source/Release/*.dll XEngine_Release/
85+ cp -r XEngine_Source/Release/*.exe XEngine_Release/
86+ cp -r XEngine_Source/VSCopy_x86.bat XEngine_Release/
87+ cd XEngine_Release
88+ .\VSCopy_x86.bat
89+ shell : pwsh
90+ - name : Conditional Step for x86 Debug
91+ if : matrix.configuration == 'Debug' && matrix.platform == 'x86'
92+ run : |
93+ cp -r XEngine_Source/Debug/*.dll XEngine_Release/
94+ cp -r XEngine_Source/Debug/*.exe XEngine_Release/
95+ cp -r XEngine_Source/VSCopy_x86.bat XEngine_Release/
96+ cd XEngine_Release
97+ .\VSCopy_x86.bat
98+ shell : pwsh
0 commit comments