-
Notifications
You must be signed in to change notification settings - Fork 3
254 lines (222 loc) · 7.54 KB
/
build-win.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
name: Build Windows
on:
workflow_dispatch:
workflow_call:
push:
branches:
- 'master'
tags:
- '*'
jobs:
###########################################################################
build:
runs-on: ${{ matrix.os }}
timeout-minutes: 15
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
MODE: release
TARGET_OS: win
TARGET_ARCH: ${{ matrix.arch }}
TARGET_CPUREV: ${{ matrix.cpurev }}
JOBS: 4
strategy:
fail-fast: false
matrix:
os: [windows-2019,windows-2022]
arch: [x64,x86,arm64]
cpurev: [legacy, default, modern]
steps:
# Checkout
- name: Checkout
uses: actions/checkout@v4
# Upgrade LLVM
#- name: Upgrade LLVM
# run: choco upgrade llvm -y
# Developer Console (X64)
- name: MSVC Developer Console (X64)
if: matrix.arch == 'x64'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64
# Developer Console (X86)
- name: MSVC Developer Console (X86)
if: matrix.arch == 'x86'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64_x86
# Developer Console (ARM64)
- name: MSVC Developer Console (ARM64)
if: matrix.arch == 'arm64'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64_arm64
# Clang Version
- name: Clang Version
run: clang --version
# Build
- name: Build
run: |
make -j${{ env.JOBS }}
# Binary Info
- name: Binary Info
run: |
dumpbin /dependents /exports ./build/make/bin/win-${{ env.TARGET_ARCH }}/CppCore.Example.Server.exe
dumpbin /dependents /exports ./build/make/bin/win-${{ env.TARGET_ARCH }}/CppCore.Example.Client.exe
dumpbin /dependents /exports ./build/make/bin/win-${{ env.TARGET_ARCH }}/CppCore.Example.UI.exe
dumpbin /dependents /exports ./build/make/bin/win-${{ env.TARGET_ARCH }}/CppCore.Test.exe
dumpbin /dependents /exports ./build/make/bin/win-${{ env.TARGET_ARCH }}/CppCore.Debug.exe
dumpbin /dependents /exports ./build/make/lib/win-${{ env.TARGET_ARCH }}/libcppcore.dll
# PDB Info
- name: PDB Info
run: |
echo CppCore.Example.Server
llvm-pdbutil dump --summary ./build/make/bin/win-${{ env.TARGET_ARCH }}/CppCore.Example.Server.pdb
echo CppCore.Example.Client
llvm-pdbutil dump --summary ./build/make/bin/win-${{ env.TARGET_ARCH }}/CppCore.Example.Client.pdb
echo CppCore.Example.UI
llvm-pdbutil dump --summary ./build/make/bin/win-${{ env.TARGET_ARCH }}/CppCore.Example.UI.pdb
echo CppCore.Test
llvm-pdbutil dump --summary ./build/make/bin/win-${{ env.TARGET_ARCH }}/CppCore.Test.pdb
echo CppCore.Debug
llvm-pdbutil dump --summary ./build/make/bin/win-${{ env.TARGET_ARCH }}/CppCore.Debug.pdb
echo CppCore.Interface.C
llvm-pdbutil dump --summary ./build/make/lib/win-${{ env.TARGET_ARCH }}/libcppcore.pdb
# Test
- name: Test
if: matrix.arch == 'x64' || matrix.arch == 'x86'
run: make test
# Upload Binaries
- name: Upload Binaries
uses: actions/upload-artifact@v4
with:
name: Binaries (${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.cpurev }})
path: |
./build/make/bin/win-${{ matrix.arch }}/*.exe
./build/make/bin/win-${{ matrix.arch }}/*.pdb
# Upload Libraries
- name: Upload Libraries
uses: actions/upload-artifact@v4
with:
name: Libraries (${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.cpurev }})
path: |
./build/make/lib/win-${{ matrix.arch }}/*.dll
./build/make/lib/win-${{ matrix.arch }}/*.lib
./build/make/lib/win-${{ matrix.arch }}/*.pdb
###########################################################################
dist:
needs: build
runs-on: ${{ matrix.os }}
timeout-minutes: 15
env:
JOBS: 4
strategy:
fail-fast: false
matrix:
os: [windows-2022]
cpurev: [legacy, default, modern]
steps:
# Checkout
- name: Checkout
uses: actions/checkout@v4
# Download X64 Binaries
- name: Download X64 Binaries
uses: actions/download-artifact@v4
with:
name: Binaries (${{ matrix.os }}-x64-${{ matrix.cpurev }})
path: ./build/make/bin/win-x64/
# Download X64 Libraries
- name: Download X64 Libraries
uses: actions/download-artifact@v4
with:
name: Libraries (${{ matrix.os }}-x64-${{ matrix.cpurev }})
path: ./build/make/lib/win-x64/
# Download X86 Binaries
- name: Download X86 Binaries
uses: actions/download-artifact@v4
with:
name: Binaries (${{ matrix.os }}-x86-${{ matrix.cpurev }})
path: ./build/make/bin/win-x86/
# Download X86 Libraries
- name: Download X86 Libraries
uses: actions/download-artifact@v4
with:
name: Libraries (${{ matrix.os }}-x86-${{ matrix.cpurev }})
path: ./build/make/lib/win-x86/
# Download ARM64 Binaries
- name: Download ARM64 Binaries
uses: actions/download-artifact@v4
with:
name: Binaries (${{ matrix.os }}-arm64-${{ matrix.cpurev }})
path: ./build/make/bin/win-arm64/
# Download ARM64 Libraries
- name: Download ARM64 Libraries
uses: actions/download-artifact@v4
with:
name: Libraries (${{ matrix.os }}-arm64-${{ matrix.cpurev }})
path: ./build/make/lib/win-arm64/
# Developer Console (X64)
- name: MSVC Developer Console (X64)
uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64
# Load Code Signing Certificate
- name: Load Code Signing Certificate
shell: pwsh
env:
PFX_BASE64: ${{ secrets.SIGN_PFX_FILE }}
run: |
echo $env:PFX_BASE64 > ./certs/TrueCert.pfx.base64
certutil -decode ./certs/TrueCert.pfx.base64 ./certs/TrueCert.pfx
# Pack
- name: Make (dist)
env:
SIGN_PFX_FILE: ../../certs/TrueCert.pfx
SIGN_PFX_PASS: ${{ secrets.SIGN_PFX_PASS }}
PUBLISHERCN: Clint Banzhaf
PUBLISHER: CN=Clint Banzhaf, O=Clint Banzhaf, S=Baden-Württemberg, C=DE
run: |
make dist -j${{ env.JOBS }}
# Install Python
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
# Install Python Packages
- name: Install Python Packages
run: |
python --version
python -m pip install build
python -m pip install pytest crc32c pbkdf2-reboot
# Python Wheel (x64)
- name: Python Wheel (x64)
run: make TARGET_ARCH=x64 CppCore.Interface.Python
# Test Python
- name: Test Python
run: |
cd src/CppCore.Interface.Python
pytest
# Python Wheel (x86)
- name: Python Wheel (x86)
run: make TARGET_ARCH=x86 CppCore.Interface.Python
# Python Wheel (arm64)
- name: Python Wheel (arm64)
run: make TARGET_ARCH=arm64 CppCore.Interface.Python
# Upload
- name: Upload
uses: actions/upload-artifact@v4
with:
name: Packages (${{ matrix.os }}-${{ matrix.cpurev }})
path: |
./dist/win-10/*.appxbundle
./dist/win-10/*.appxupload
./dist/win-10/*.zip
./dist/win-10/*.whl
# Upload to Github Release
- name: Upload to Github Release
uses: softprops/action-gh-release@v1
if: matrix.cpurev == 'default' && startsWith(github.ref, 'refs/tags/')
with:
token: ${{ secrets.PAT_GITHUB_ACTIONS }}
files: |
./dist/win-10/*.appxbundle
./dist/win-10/*.zip