-
Notifications
You must be signed in to change notification settings - Fork 240
335 lines (293 loc) · 10.5 KB
/
post_weekly_release.yaml
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
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
name: post-weekly-release
run-name: Build, test, generate signed artefacts and optionally prepare release
on:
workflow_dispatch:
push:
branches:
- main
tags:
- '*'
schedule:
- cron: '17 2 * * 1'
jobs:
coverity:
if: ${{ (!startsWith(github.event.ref, 'refs/tags/')) && (github.repository_owner == 'Arm-software') }}
name: Run Coverity Static Analysis
runs-on: [self-hosted-ubuntu-latest-x64]
steps:
- name: Clean workspace
uses: AutoModality/action-clean@v1
- name: Git checkout
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Coverity Preparation
run: |
export PATH=$PATH:/usr/local/cov-analysis/bin
mkdir build_cov
cd build_cov
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../ -DASTCENC_ISA_AVX2=ON ..
cov-configure --config ${GITHUB_WORKSPACE}/coverity.conf --template --compiler cc --comptype gcc
cov-configure --config ${GITHUB_WORKSPACE}/coverity.conf --template --compiler c++ --comptype g++
- name: Coverity Build
run: |
export PATH=$PATH:/usr/local/cov-analysis/bin
cd build_cov
cov-build --config ${GITHUB_WORKSPACE}/coverity.conf --dir ${GITHUB_WORKSPACE}/intermediate make install
- name: Coverity Analyse
run: |
export PATH=$PATH:/usr/local/cov-analysis/bin
cd build_cov
cov-analyze --dir ${GITHUB_WORKSPACE}/intermediate
- name: Coverity Upload
env:
COVERITY_KEY: ${{ secrets.COVERITY_KEY }}
run: |
export PATH=$PATH:/usr/local/cov-analysis/bin
echo "${COVERITY_KEY}" > coverity.key
chmod 400 coverity.key
cd build_cov
cov-commit-defects \
--dir ${GITHUB_WORKSPACE}/intermediate \
--stream astcenc-master \
--url https://coverity.cambridge.arm.com \
--auth-key-file ../coverity.key \
--strip-path ${GITHUB_WORKSPACE}
build-ubuntu:
name: Build and test on Ubuntu
runs-on: ubuntu-22.04
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Build R
run: |
export CXX=clang++
mkdir build_rel
cd build_rel
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../ -DASTCENC_ISA_AVX2=ON -DASTCENC_ISA_SSE41=ON -DASTCENC_ISA_SSE2=ON -DASTCENC_PACKAGE=x64 ..
make install package -j4
- name: Build D
run: |
export CXX=clang++
mkdir build_dbg
cd build_dbg
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../ -DASTCENC_ISA_AVX2=ON -DASTCENC_ISA_SSE41=ON -DASTCENC_ISA_SSE2=ON -DASTCENC_DECOMPRESSOR=ON ..
make -j4
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: astcenc-linux-x86_64
path: |
build_rel/*.zip
build_rel/*.zip.sha256
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Get Python modules
run: |
python -m pip install --upgrade pip
pip install numpy Pillow
- name: Python Tests
run: |
python ./Test/astc_test_functional.py
python ./Test/astc_test_image.py --encoder=all-x86 --test-set Small
build-macos:
name: Build and test on MacOS
runs-on: macos-12
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Build R
run: |
mkdir build_rel
cd build_rel
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../ -DASTCENC_PACKAGE=universal ..
make install package -j4
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: astcenc-macos-universal
path: |
build_rel/*.zip
build_rel/*.zip.sha256
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Get Python modules
run: |
python -m pip install --upgrade pip
pip install numpy Pillow
- name: Python Tests
run: |
python ./Test/astc_test_image.py --test-set Small --encoder universal
build-windows-msvc-ClangCL:
name: Build and test on Windows MSVC
runs-on: windows-2022
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Setup Visual Studio x86_64
uses: ilammy/msvc-dev-cmd@v1
- name: Build R x86_64
run: |
mkdir build_rel
cd build_rel
cmake -G "Visual Studio 17 2022" -T ClangCL -DCMAKE_INSTALL_PREFIX=../ -DASTCENC_ISA_AVX2=ON -DASTCENC_ISA_SSE41=ON -DASTCENC_ISA_SSE2=ON -DASTCENC_PACKAGE=x64 ..
msbuild astcencoder.sln -property:Configuration=Release
msbuild PACKAGE.vcxproj -property:Configuration=Release
msbuild INSTALL.vcxproj -property:Configuration=Release
shell: cmd
- name: Setup Visual Studio arm64
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x86_arm64
- name: Build R arm64
run: |
mkdir build_rel_arm64
cd build_rel_arm64
cmake -G "Visual Studio 17 2022" -A ARM64 -T ClangCL -DCMAKE_INSTALL_PREFIX=../ -DASTCENC_ISA_NEON=ON -DASTCENC_PACKAGE=arm64 ..
msbuild astcencoder.sln -property:Configuration=Release
msbuild PACKAGE.vcxproj -property:Configuration=Release
msbuild INSTALL.vcxproj -property:Configuration=Release
shell: cmd
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: astcenc-windows-multi-cl
path: |
build_rel/*.zip
build_rel/*.zip.sha256
build_rel_arm64/*.zip
build_rel_arm64/*.zip.sha256
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Get Python modules
run: |
python -m pip install --upgrade pip
pip install numpy Pillow
shell: cmd
- name: Python Tests
run: |
python ./Test/astc_test_image.py --test-set Small
shell: cmd
sign-binaries:
if: github.repository_owner == 'Arm-software'
name: Sign Windows and Mac
runs-on: [self-hosted-ubuntu-latest-x64]
needs: [build-macos, build-windows-msvc-ClangCL]
steps:
- name: Clean workspace
uses: AutoModality/action-clean@v1
- name: Checkout signing code
env:
SIGNING_REPO_URL: ${{ secrets.SIGNING_REPO_URL }}
run: |
git clone --depth 1 ${SIGNING_REPO_URL}
- name: Install code sign v2 client
env:
ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }}
ARTIFACTORY_APIKEY: ${{ secrets.ARTIFACTORY_APIKEY }}
ARTIFACTORY_FQDN: ${{ secrets.ARTIFACTORY_FQDN }}
run: |
python3.11 -m venv cs
. ./cs/bin/activate
pip install -i https://${ARTIFACTORY_USER}:${ARTIFACTORY_APIKEY}@${ARTIFACTORY_FQDN}/artifactory/api/pypi/dsgcore.pypi/simple code-signer-client
- name: Download Windows binaries
uses: actions/download-artifact@v4
with:
name: astcenc-windows-multi-cl
path: windows
- name: Download Mac binaries
uses: actions/download-artifact@v4
with:
name: astcenc-macos-universal
path: mac
- name: Sign and notarize Mac
env:
CODESIGNER_USER: ${{ secrets.CODESIGNER_USER }}
run: |
. ./cs/bin/activate
cd mac
python3 ${GITHUB_WORKSPACE}/signing/macos-client-wrapper.py ${CODESIGNER_USER} *.zip
- name: Sign Windows binaries
env:
ARTIFACTORY_APIKEY: ${{ secrets.ARTIFACTORY_APIKEY }}
run: |
. ./cs/bin/activate
cd windows
for FILENAME in */*; do mv ${FILENAME} .; done
for ZIPFILE in *.zip; do python3 ../signing/windows-client-wrapper.py -b ${GITHUB_RUN_NUMBER} -t ${ARTIFACTORY_APIKEY} ${ZIPFILE}; done
- name: Upload signed binaries
uses: actions/upload-artifact@v4
with:
name: signed-binaries
path: |
windows/*
mac/*
- name: Tidy intermediate artefacts
uses: geekyeggo/delete-artifact@v5
with:
name: |
astcenc-windows-multi-cl
astcenc-macos-universal
prepare-release:
if: ${{ (startsWith(github.event.ref, 'refs/tags/')) && (github.repository_owner == 'Arm-software') }}
name: Prepare release
runs-on: ubuntu-22.04
needs: [sign-binaries, build-ubuntu]
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Download signed binaries
uses: actions/download-artifact@v4
with:
name: signed-binaries
path: prepare-release
- name: Download Linux binaries
uses: actions/download-artifact@v4
with:
name: astcenc-linux-x86_64
path: prepare-release
- name: Flatten file structure
run: |
cd prepare-release
for FILENAME in */*; do mv ${FILENAME} .; done
rmdir windows
rmdir mac
- name: Create checksum file
run: |
cd prepare-release
cat *.sha256 > release-sha256.txt
rm *.sha256
- name: Create release body
run: |
export STATUS_DATE=$(date "+%B %Y")
GITHUB_REF=${{ github.ref }} ; export RELEASE_VERSION=${GITHUB_REF##*/}
export SHA_CHECKSUMS=$(cat prepare-release/release-sha256.txt)
envsubst < .github/workflows/release_body_template.md > prepare-release/release_body.md
- name: Create release
id: create_release
uses: comnoco/create-release-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body_path: prepare-release/release_body.md
draft: true
- name: Attach artefacts
uses: AButler/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
release-id: ${{ steps.create_release.outputs.id }}
files: "prepare-release/astcenc-*-*-*.zip;prepare-release/release-sha256.txt"