-
Notifications
You must be signed in to change notification settings - Fork 2
77 lines (68 loc) · 2.7 KB
/
msbuild.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: windows build workflows
on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]
permissions:
contents: read
jobs:
build:
strategy:
# 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.
fail-fast: false
matrix:
configuration: [Debug ,Release]
platform: [x86 ,x64]
runs-on: windows-latest # 最新的 Windows 环境
steps:
# 检出您的主仓库代码
- name: Checkout main repository code
uses: actions/checkout@v4
with:
ref: 'develop'
# 检出依赖的xengine仓库到指定的xengine目录
- name: Checkout dependency repository (xengine)
uses: actions/checkout@v4
with:
repository: libxengine/libxengine
path: xengine
- name: sub module checkout (opensource)
run: |
git submodule init
git submodule update
shell: pwsh
# 设置依赖库的环境变量
- name: Set up Dependency Environment Variables
run: |
echo "XENGINE_INCLUDE=${{ github.workspace }}/xengine" | Out-File -FilePath $env:GITHUB_ENV -Append
echo "XENGINE_LIB32=${{ github.workspace }}/xengine/XEngine_Windows/x86" | Out-File -FilePath $env:GITHUB_ENV -Append
echo "XENGINE_LIB64=${{ github.workspace }}/xengine/XEngine_Windows/x64" | Out-File -FilePath $env:GITHUB_ENV -Append
shell: pwsh
# 配置 MSBuild 的路径,准备构建 VC++ 项目
- name: Setup MSBuild
uses: microsoft/[email protected]
#编译
- name: Build Solution
run: msbuild XEngine_Source/XEngine_StorageApp.sln /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }}
#测试
- name: Conditional Step for x86 Release
if: matrix.configuration == 'Release' && matrix.platform == 'x86'
run: |
cp -r XEngine_Source/Release/*.dll XEngine_Release/
cp -r XEngine_Source/Release/*.exe XEngine_Release/
cp -r XEngine_Source/VSCopy_x86.bat XEngine_Release/
cd XEngine_Release
./VSCopy_x86.bat
./XEngine_StorageApp.exe -t
shell: pwsh
- name: Conditional Step for x86 Debug
if: matrix.configuration == 'Debug' && matrix.platform == 'x86'
run: |
cp -r XEngine_Source/Debug/*.dll XEngine_Release/
cp -r XEngine_Source/Debug/*.exe XEngine_Release/
cp -r XEngine_Source/VSCopy_x86.bat XEngine_Release/
cd XEngine_Release
./VSCopy_x86.bat
./XEngine_StorageApp.exe -t
shell: pwsh