@@ -2,32 +2,29 @@ name: windows build workflows
22
33on :
44 push :
5- branches : [ "develop" ]
6- pull_request :
7- branches : [ "develop" ]
8-
9- permissions :
10- contents : read
5+ branches :
6+ - ' develop '
7+ paths :
8+ - ' XEngine_Source/** '
9+ - ' XEngine_Release/** '
10+ - ' .github/** '
1111
1212jobs :
1313 build :
1414 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.
1615 fail-fast : false
1716 matrix :
1817 configuration : [Debug ,Release]
1918 platform : [x86 ,x64]
2019
21- runs-on : windows-latest # 最新的 Windows 环境
20+ runs-on : windows-latest
2221
2322 steps :
24- # 检出您的主仓库代码
2523 - name : Checkout main repository code
2624 uses : actions/checkout@v4
2725 with :
2826 ref : ' develop'
2927
30- # 检出依赖的xengine仓库到指定的xengine目录
3128 - name : Checkout dependency repository (xengine)
3229 uses : actions/checkout@v4
3330 with :
@@ -63,21 +60,33 @@ jobs:
6360 ./vcpkg.exe integrate install
6461 shell : pwsh
6562
66- # 设置依赖库的环境变量
67- - name : Set up Dependency Environment Variables
63+ - name : Set up Dependency x86_64 Environment
64+ if : matrix.platform == 'x64'
6865 run : |
6966 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
67+ echo "XENGINE_LIB64=${{ github.workspace }}/libxengine/XEngine_Windows" | Out-File -FilePath $env:GITHUB_ENV -Append
7268 shell : pwsh
73-
74- # 配置 MSBuild 的路径,准备构建 VC++ 项目
69+ - name : Set up Dependency x86_32 Environment
70+ if : matrix.platform == 'x86'
71+ run : |
72+ $response = Invoke-RestMethod -Uri "https://api.github.com/repos/libxengine/libxengine/releases/latest" -Headers @{"Accept"="application/vnd.github.v3+json"}
73+ $latest_tag = $response.tag_name
74+ Write-Host "Latest Tag: $latest_tag"
75+
76+ $url = "https://github.com/libxengine/libxengine/releases/download/$latest_tag/XEngine_Windows_x86-32.zip"
77+ Invoke-WebRequest -Uri $url -OutFile "XEngine_Windows_x86-32.zip"
78+ Expand-Archive -Path ./XEngine_Windows_x86-32.zip -DestinationPath ./XEngine_Windows -Force
79+
80+ echo "XENGINE_INCLUDE=${{ github.workspace }}/XEngine_Windows" | Out-File -FilePath $env:GITHUB_ENV -Append
81+ echo "XENGINE_LIB32=${{ github.workspace }}/XEngine_Windows/XEngine_Windows" | Out-File -FilePath $env:GITHUB_ENV -Append
82+ shell : pwsh
83+
7584 - name : Setup MSBuild
7685 uses : microsoft/setup-msbuild@v2
77- # 编译
86+
7887 - name : Build Solution
7988 run : msbuild XEngine_Source/XEngine.sln /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }}
80- # 测试
89+
8190 - name : Conditional Step for x86 Release
8291 if : matrix.configuration == 'Release' && matrix.platform == 'x86'
8392 run : |
@@ -86,13 +95,28 @@ jobs:
8695 cp -r XEngine_Source/VSCopy_x86.bat XEngine_Release/
8796 cd XEngine_Release
8897 .\VSCopy_x86.bat
98+ ./XEngine_StreamMediaApp -t
8999 shell : pwsh
90- - name : Conditional Step for x86 Debug
91- if : matrix.configuration == 'Debug ' && matrix.platform == 'x86 '
100+ - name : Conditional Step for x64 Debug
101+ if : matrix.configuration == 'Release ' && matrix.platform == 'x64 '
92102 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/
103+ cp -r XEngine_Source/x64/Release /*.dll XEngine_Release/
104+ cp -r XEngine_Source/x64/Release /*.exe XEngine_Release/
105+ cp -r XEngine_Source/VSCopy_x64 .bat XEngine_Release/
96106 cd XEngine_Release
97- .\VSCopy_x86.bat
98- shell : pwsh
107+ .\VSCopy_x64.bat
108+ shell : pwsh
109+
110+ - name : Upload folder as artifact with x86
111+ if : matrix.configuration == 'Release' && matrix.platform == 'x86'
112+ uses : actions/upload-artifact@v4
113+ with :
114+ name : XEngine_StreamMediaApp-x86_32-Windows
115+ path : XEngine_Release/
116+
117+ - name : Upload folder as artifact with x64
118+ if : matrix.configuration == 'Release' && matrix.platform == 'x64'
119+ uses : actions/upload-artifact@v4
120+ with :
121+ name : XEngine_StreamMediaApp-x86_64-Windows
122+ path : XEngine_Release/
0 commit comments