-
Notifications
You must be signed in to change notification settings - Fork 7
263 lines (232 loc) · 7.33 KB
/
release.yml
File metadata and controls
263 lines (232 loc) · 7.33 KB
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
255
256
257
258
259
260
261
262
263
name: Release
on:
workflow_dispatch:
inputs:
version:
description: "Release version, for example v1.2.3 or 1.2.3"
required: true
concurrency:
group: release
cancel-in-progress: false
env:
ARTIFACT_ROOT: release-assets
jobs:
release-metadata:
name: Release metadata
runs-on: ubuntu-latest
outputs:
tag_name: ${{ steps.tag.outputs.tag_name }}
steps:
- id: tag
shell: bash
run: |
set -euo pipefail
raw_tag="${{ inputs.version }}"
if [[ "${raw_tag}" == v* ]]; then
tag_name="${raw_tag}"
else
tag_name="v${raw_tag}"
fi
echo "tag_name=${tag_name}" >> "$GITHUB_OUTPUT"
ubuntu-cpu:
name: Ubuntu ${{ matrix.build }} CPU
needs: release-metadata
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- build: x64
os: ubuntu-22.04
- build: arm64
os: ubuntu-24.04-arm
steps:
- name: Clone
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Dependencies
shell: bash
run: |
set -euo pipefail
sudo apt-get update
sudo apt-get install -y build-essential file
- name: Toolchain workaround
if: ${{ contains(matrix.os, 'ubuntu-24.04') }}
shell: bash
run: |
set -euo pipefail
sudo apt-get install -y gcc-14 g++-14
echo "CC=gcc-14" >> "$GITHUB_ENV"
echo "CXX=g++-14" >> "$GITHUB_ENV"
- name: Build
shell: bash
run: |
set -euo pipefail
${CXX:-g++} -std=c++17 -O3 -DNDEBUG \
-I. -Iinclude \
-o quadtrix main.cpp
file quadtrix
- name: Smoke test
shell: bash
run: |
set +e
./quadtrix --chat >/dev/null 2>&1
exit 0
- name: Pack artifacts
shell: bash
run: |
set -euo pipefail
package="quadtrix-${{ needs.release-metadata.outputs.tag_name }}-bin-ubuntu-${{ matrix.build }}-cpu"
mkdir -p "${ARTIFACT_ROOT}/${package}"
cp quadtrix README.md LICENSE "${ARTIFACT_ROOT}/${package}/"
tar -czf "${package}.tar.gz" -C "${ARTIFACT_ROOT}" "${package}"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: quadtrix-bin-ubuntu-${{ matrix.build }}-cpu
path: quadtrix-${{ needs.release-metadata.outputs.tag_name }}-bin-ubuntu-${{ matrix.build }}-cpu.tar.gz
if-no-files-found: error
retention-days: 30
windows-cpu:
name: Windows ${{ matrix.arch }} CPU
needs: release-metadata
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
include:
- arch: x64
vcvars: x64
- arch: arm64
vcvars: amd64_arm64
steps:
- name: Clone
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.vcvars }}
cl /nologo /std:c++17 /O2 /DNDEBUG /EHsc /Iinclude /I. main.cpp /Fe:quadtrix.exe
- name: Smoke test
if: ${{ matrix.arch == 'x64' }}
shell: pwsh
run: |
$ErrorActionPreference = 'Continue'
& .\quadtrix.exe --chat | Out-Null
exit 0
- name: Pack artifacts
shell: pwsh
run: |
$package = "quadtrix-${{ needs.release-metadata.outputs.tag_name }}-bin-windows-${{ matrix.arch }}-cpu"
New-Item -ItemType Directory -Force "${env:ARTIFACT_ROOT}\${package}" | Out-Null
Copy-Item quadtrix.exe "${env:ARTIFACT_ROOT}\${package}\"
Copy-Item README.md, LICENSE "${env:ARTIFACT_ROOT}\${package}\"
Compress-Archive -Path "${env:ARTIFACT_ROOT}\${package}\*" -DestinationPath "${package}.zip" -Force
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: quadtrix-bin-windows-${{ matrix.arch }}-cpu
path: quadtrix-${{ needs.release-metadata.outputs.tag_name }}-bin-windows-${{ matrix.arch }}-cpu.zip
if-no-files-found: error
retention-days: 30
macos-cpu:
name: macOS ${{ matrix.build }} CPU
needs: release-metadata
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- build: arm64
arch: arm64
os: macos-14
steps:
- name: Clone
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build
shell: bash
run: |
set -euo pipefail
clang++ -std=c++17 -O3 -DNDEBUG -arch ${{ matrix.arch }} \
-I. -Iinclude \
-o quadtrix main.cpp
file quadtrix
- name: Smoke test
shell: bash
run: |
set +e
./quadtrix --chat >/dev/null 2>&1
exit 0
- name: Pack artifacts
shell: bash
run: |
set -euo pipefail
package="quadtrix-${{ needs.release-metadata.outputs.tag_name }}-bin-macos-${{ matrix.build }}-cpu"
mkdir -p "${ARTIFACT_ROOT}/${package}"
cp quadtrix README.md LICENSE "${ARTIFACT_ROOT}/${package}/"
tar -czf "${package}.tar.gz" -C "${ARTIFACT_ROOT}" "${package}"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: quadtrix-bin-macos-${{ matrix.build }}-cpu
path: quadtrix-${{ needs.release-metadata.outputs.tag_name }}-bin-macos-${{ matrix.build }}-cpu.tar.gz
if-no-files-found: error
retention-days: 30
publish-release:
name: Publish GitHub release
needs:
- release-metadata
- ubuntu-cpu
- windows-cpu
- macos-cpu
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: Write release notes
shell: bash
run: |
cat > release-notes.md <<'EOF'
macOS/iOS:
macOS Apple Silicon (arm64)
macOS Apple Silicon (arm64, KleidiAI enabled) DISABLED
macOS Intel (x64) SKIPPED
iOS XCFramework DISABLED
Linux:
Ubuntu x64 (CPU)
Ubuntu arm64 (CPU)
Ubuntu s390x (CPU) SKIPPED
Ubuntu x64 (Vulkan) DISABLED
Ubuntu arm64 (Vulkan) DISABLED
Ubuntu x64 (ROCm 7.2) DISABLED
Ubuntu x64 (OpenVINO) DISABLED
Ubuntu x64 (SYCL FP32) DISABLED
Android:
Android arm64 (CPU) DISABLED
Windows:
Windows x64 (CPU)
Windows arm64 (CPU)
Windows x64 (CUDA 12) - CUDA 12.4 DLLs DISABLED
Windows x64 (CUDA 13) - CUDA 13.3 DLLs DISABLED
Windows x64 (Vulkan) DISABLED
Windows x64 (SYCL) DISABLED
Windows x64 (HIP) DISABLED
EOF
- name: Publish release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.release-metadata.outputs.tag_name }}
target_commitish: ${{ github.sha }}
prerelease: false
body_path: release-notes.md
files: dist/*