-
Notifications
You must be signed in to change notification settings - Fork 11
235 lines (227 loc) · 8.38 KB
/
releases-windows.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
name: OnDemand Build Artifacts (MSVC)
on:
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
type: choice
options:
- info
- warning
- debug
tags:
description: 'Test scenario tags'
required: false
type: boolean
schedule:
- cron: '0 16 * * *'
concurrency:
group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }}
cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }}
defaults:
run:
shell: cmd
env:
CACHE_EPOCH: 129-1
GOPROXY: direct
jobs:
windows-release:
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
arch: [x64, x86, arm64]
crt-linkage: [dynamic]
build_type: [Release]
env:
BUILD_TYPE: '${{ matrix.build_type }}'
steps:
- uses: actions/checkout@v4
- name: Checkout with shallow submodules
run: |
# unshallow must come first otherwise submodule may be get unshallowed
git fetch --tags --unshallow
git submodule update --init --depth 1
- name: Cache clang, nasm, nsis and wixtoolset 3
id: clang-cache
uses: actions/cache@v4
with:
path: |
third_party/nasm
third_party/llvm-build/Release+Asserts
third_party/wix311
third_party/nsis
key: ${{ runner.os }}-toolchain-nsis-${{ hashFiles('CLANG_REVISION') }}-v${{ env.CACHE_EPOCH }}
- name: Cache msvc curl
id: curl-cache
uses: actions/cache@v4
with:
path: |
third_party/libcurl-vc16-arm64-release-static-ipv6-sspi-schannel
third_party/libcurl-vc16-x64-release-static-ipv6-sspi-schannel
third_party/libcurl-vc16-x86-release-static-ipv6-sspi-schannel
key: ${{ runner.os }}-msvc-dynamic-curl-vc16-${{ matrix.arch }}-v2
- name: Cache depot_tools
id: depot-cache
uses: actions/cache@v4
with:
path: |
third_party/depot_tools
key: ${{ runner.os }}-depot_tools-v1
- name: Cache crashpad build stage
id: crashpad-cache
uses: actions/cache@v4
with:
path: |
third_party/crashpad
key: ${{ runner.os }}-msvc-dynamic-${{ matrix.arch }}-crashpad-${{ hashFiles('CRASHPAD_COMMIT') }}-v${{ env.CACHE_EPOCH }}
- uses: actions/setup-go@v5
with:
go-version: '>=1.20.0'
cache-dependency-path: |
tools/go.sum
third_party/boringssl/src/go.sum
- name: Build build tool
run: |
cd tools
go build
- name: "Download dependency: clang, nasm, nsis and wixtoolset 3"
if: ${{ steps.clang-cache.outputs.cache-hit != 'true' }}
run: |
scripts\download-toolchain.bat
- name: "Download dependency: curl"
if: ${{ steps.curl-cache.outputs.cache-hit != 'true' }}
run: |
scripts\download-curl-msvc.bat ${{ matrix.arch }}
- name: "Download dependency: cmake (chocolatey)"
run: |
REM choco install -y cmake.portable --version=3.28.5
cmake --version
- name: "Download dependency: ninja (chocolatey)"
run: |
choco install -y ninja
ninja --version
- uses: actions/setup-python@v5
if: ${{ steps.depot-cache.outputs.cache-hit != 'true' || steps.crashpad-cache.outputs.cache-hit != 'true' }}
with:
python-version: '3.11'
- name: Download and Build Crashpad (include depot_tools)
if: ${{ steps.depot-cache.outputs.cache-hit != 'true' || steps.crashpad-cache.outputs.cache-hit != 'true' }}
shell: bash
run: |
WITH_CPU=${{ matrix.arch }} ./scripts/build-crashpad.sh
- name: Build
run: |
set VCToolsVersion=14.29
set Winsdk=10.0.19041.0
set "WindowsSDKVersion=%Winsdk%\"
if "${{ matrix.arch }}" == "arm64" (call :SetNewVCToolsVersion)
set vsdevcmd=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat
set "VSCMD_START_DIR=%CD%"
set Platform=${{ matrix.arch }}
call "%vsdevcmd%" -arch=%Platform% -host_arch=amd64 -winsdk=%Winsdk% -no_logo -vcvars_ver=%VCToolsVersion%
tools\build -msvc-tgt-arch=${{ matrix.arch }} -msvc-crt-linkage=${{ matrix.crt-linkage }} -build-benchmark -build-test || exit /b
exit /b 0
:SetNewVCToolsVersion
set VCToolsVersion=
- name: Run tests
if: ${{ matrix.arch == 'x64' || matrix.arch == 'x86' }}
run: |
build-msvc-${{ matrix.arch }}-${{ matrix.crt-linkage }}\yass_test || exit /b
build-msvc-${{ matrix.arch }}-${{ matrix.crt-linkage }}\yass_benchmark || exit /b
- name: Upload dist tarball (including debuginfo)
if: ${{ github.event_name == 'release' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
gh release upload ${{ github.event.release.tag_name }} *.zip *.exe
- name: Upload dist installers
if: ${{ github.event_name == 'release' && matrix.arch != 'arm64' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
gh release upload ${{ github.event.release.tag_name }} *.msi
windows-xp-release:
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
arch: [x64, x86]
crt-linkage: [static]
build_type: [Release]
env:
BUILD_TYPE: '${{ matrix.build_type }}'
steps:
- uses: actions/checkout@v4
- name: Checkout with shallow submodules
run: |
# unshallow must come first otherwise submodule may be get unshallowed
git fetch --tags --unshallow
git submodule update --init --depth 1
- name: Cache clang, nasm, nsis and wixtoolset 3
id: clang-cache
uses: actions/cache@v4
with:
path: |
third_party/nasm
third_party/llvm-build/Release+Asserts
third_party/wix311
third_party/nsis
key: ${{ runner.os }}-toolchain-nsis-${{ hashFiles('CLANG_REVISION') }}-v${{ env.CACHE_EPOCH }}
- uses: actions/setup-go@v5
with:
go-version: '>=1.20.0'
cache-dependency-path: |
tools/go.sum
third_party/boringssl/src/go.sum
- name: Build build tool
run: |
cd tools
go build
- name: "Download dependency: clang, nasm, nsis and wixtoolset 3"
if: ${{ steps.clang-cache.outputs.cache-hit != 'true' }}
run: |
scripts\download-toolchain.bat
- name: "Download dependency: cmake (chocolatey)"
run: |
REM choco install -y cmake.portable --version=3.28.5
cmake --version
- name: "Download dependency: ninja (chocolatey)"
run: |
choco install -y ninja
ninja --version
- name: Patch libcxx for windows xp
shell: bash
run: |
pushd third_party/libc++/trunk
patch -p1 < ../winxp.patch
popd
pushd third_party/benchmark
patch -p1 < ../benchmark-winxp-fix.patch
popd
- name: Build
run: |
set VCToolsVersion=14.16.27012
set "VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC"
set "WindowsSDKVersion=10.0.10240.0\"
set "WindowsSdkDir=C:\Program Files (x86)\Windows Kits\10"
set Platform=${{ matrix.arch }}
set VSCMD_ARG_TGT_ARCH=${{ matrix.arch }}
call "scripts\callxp-%Platform%.cmd"
tools\build -msvc-tgt-arch=${{ matrix.arch }} -msvc-crt-linkage=${{ matrix.crt-linkage }} -msvc-allow-xp -build-test -build-benchmark || exit /b
goto :eof
- name: Run tests
run: |
build-msvc-winxp-${{ matrix.arch }}-${{ matrix.crt-linkage }}\yass_test || exit /b
build-msvc-winxp-${{ matrix.arch }}-${{ matrix.crt-linkage }}\yass_benchmark || exit /b
- name: Upload dist tarball (including debuginfo)
if: ${{ github.event_name == 'release' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
gh release upload ${{ github.event.release.tag_name }} *.msi *.exe *.zip