Repository navigation
346 lines (341 loc) · 13.9 KB
/
Copy pathrelease-packages.yaml
File metadata and controls
346 lines (341 loc) · 13.9 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
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
336
337
338
339
340
341
342
343
344
345
346
on:
release:
types: [created]
env:
cvc5-version: "1.3.4"
name: Upload additional release assets
jobs:
ubuntu-24_04-package:
runs-on: ubuntu-24.04
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v7
with:
submodules: recursive
- name: Fetch dependencies
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y g++ gdb flex bison cmake ninja-build maven jq libxml2-utils dpkg-dev ccache z3
- name: Confirm z3 solver is available and log the version installed
run: z3 --version
- name: Install cvc5
uses: ./.github/actions/install-cvc5
with:
version: ${{ env.cvc5-version }}
- name: Restore ccache
id: restore-ccache
uses: actions/cache/restore@v6
with:
path: .ccache
key: ${{ runner.os }}-24.04-Release-${{ github.ref }}-${{ github.sha }}-RELEASEPKG
restore-keys: |
${{ runner.os }}-24.04-Release-${{ github.ref }}
${{ runner.os }}-24.04-Release
- name: ccache environment
run: |
echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV
echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV
- name: Configure CMake
run: cmake -S . -Bbuild -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ -Dsat_impl="minisat2;cadical"
- name: Zero ccache stats and limit in size
run: ccache -z --max-size=500M
- name: Build using Ninja
run: ninja -C build -j4
- name: Print ccache stats
run: ccache -s
- name: Run CTest
run: cd build; ctest . -V -L CORE -C Release -j4
- name: Create packages
id: create_packages
run: |
cd build
ninja package
deb_package_name="$(ls *.deb)"
echo "deb_package=./build/$deb_package_name" >> $GITHUB_OUTPUT
echo "deb_package_name=ubuntu-24.04-$deb_package_name" >> $GITHUB_OUTPUT
- name: Rename package for release
run: cp ${{ steps.create_packages.outputs.deb_package }} ${{ steps.create_packages.outputs.deb_package_name }}
- name: Upload binary packages
uses: softprops/action-gh-release@v3
with:
files: ${{ steps.create_packages.outputs.deb_package_name }}
- name: Save ccache
if: always()
uses: actions/cache/save@v6
with:
path: .ccache
key: ${{ steps.restore-ccache.outputs.cache-primary-key }}
ubuntu-24_04-arm-package:
runs-on: ubuntu-24.04-arm
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v7
with:
submodules: recursive
- name: Fetch dependencies
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y g++ gdb flex bison cmake ninja-build maven jq libxml2-utils dpkg-dev ccache z3
- name: Confirm z3 solver is available and log the version installed
run: z3 --version
- name: Install cvc5
uses: ./.github/actions/install-cvc5
with:
version: ${{ env.cvc5-version }}
- name: Restore ccache
id: restore-ccache
uses: actions/cache/restore@v6
with:
path: .ccache
key: ${{ runner.os }}-24.04-Arm-Release-${{ github.ref }}-${{ github.sha }}-RELEASEPKG
restore-keys: |
${{ runner.os }}-24.04-Arm-Release-${{ github.ref }}
${{ runner.os }}-24.04-Arm-Release
- name: ccache environment
run: |
echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV
echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV
- name: Configure CMake
run: cmake -S . -Bbuild -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ -Dsat_impl="minisat2;cadical"
- name: Zero ccache stats and limit in size
run: ccache -z --max-size=500M
- name: Build using Ninja
run: ninja -C build -j4
- name: Print ccache stats
run: ccache -s
- name: Run CTest
run: cd build; ctest . -V -L CORE -C Release -j4
- name: Create packages
id: create_packages
run: |
cd build
ninja package
deb_package_name="$(ls *.deb)"
echo "deb_package=./build/$deb_package_name" >> $GITHUB_OUTPUT
echo "deb_package_name=ubuntu-24.04-arm64-$deb_package_name" >> $GITHUB_OUTPUT
- name: Rename package for release
run: cp ${{ steps.create_packages.outputs.deb_package }} ${{ steps.create_packages.outputs.deb_package_name }}
- name: Upload binary packages
uses: softprops/action-gh-release@v3
with:
files: ${{ steps.create_packages.outputs.deb_package_name }}
- name: Save ccache
if: always()
uses: actions/cache/save@v6
with:
path: .ccache
key: ${{ steps.restore-ccache.outputs.cache-primary-key }}
ubuntu-22_04-package:
runs-on: ubuntu-22.04
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v7
with:
submodules: recursive
- name: Fetch dependencies
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y g++ gdb flex bison cmake ninja-build maven jq libxml2-utils dpkg-dev ccache z3
- name: Confirm z3 solver is available and log the version installed
run: z3 --version
- name: Install cvc5
uses: ./.github/actions/install-cvc5
with:
version: ${{ env.cvc5-version }}
- name: Restore ccache
id: restore-ccache
uses: actions/cache/restore@v6
with:
path: .ccache
key: ${{ runner.os }}-22.04-Release-${{ github.ref }}-${{ github.sha }}-RELEASEPKG
restore-keys: |
${{ runner.os }}-22.04-Release-${{ github.ref }}
${{ runner.os }}-22.04-Release
- name: ccache environment
run: |
echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV
echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV
- name: Configure CMake
run: cmake -S . -Bbuild -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ -Dsat_impl="minisat2;cadical"
- name: Zero ccache stats and limit in size
run: ccache -z --max-size=500M
- name: Build using Ninja
run: ninja -C build -j4
- name: Print ccache stats
run: ccache -s
- name: Run CTest
run: cd build; ctest . -V -L CORE -C Release -j4
- name: Create packages
id: create_packages
run: |
cd build
ninja package
deb_package_name="$(ls *.deb)"
echo "deb_package=./build/$deb_package_name" >> $GITHUB_OUTPUT
echo "deb_package_name=ubuntu-22.04-$deb_package_name" >> $GITHUB_OUTPUT
- name: Rename package for release
run: cp ${{ steps.create_packages.outputs.deb_package }} ${{ steps.create_packages.outputs.deb_package_name }}
- name: Upload binary packages
uses: softprops/action-gh-release@v3
with:
files: ${{ steps.create_packages.outputs.deb_package_name }}
- name: Save ccache
if: always()
uses: actions/cache/save@v6
with:
path: .ccache
key: ${{ steps.restore-ccache.outputs.cache-primary-key }}
windows-msi-package:
runs-on: windows-2025
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v7
with:
submodules: recursive
- name: Setup Visual Studio environment
uses: microsoft/setup-msbuild@v3
- name: Get current month for cache key
id: cache-key
run: echo "month=$(Get-Date -Format 'yyyy-MM')" >> $env:GITHUB_OUTPUT
- name: Cache Chocolatey packages
uses: actions/cache@v6
with:
path: |
C:\ProgramData\chocolatey\lib\winflexbison3
C:\ProgramData\chocolatey\bin
key: ${{ runner.os }}-choco-${{ steps.cache-key.outputs.month }}-winflexbison3
restore-keys: |
${{ runner.os }}-choco-${{ steps.cache-key.outputs.month }}
- name: Fetch dependencies
run: |
function Require-Tool($Name) {
if (-not (Get-Command $Name -ErrorAction SilentlyContinue)) {
Write-Output "::error ::Required tool '$Name' not found in PATH after Chocolatey installation."
exit 1
}
}
if (-not (Get-Command win_flex -ErrorAction SilentlyContinue))
{
# Only contact the Chocolatey servers when the package is not
# already present (restored from the cache above or pre-installed on
# the runner). This lets the step succeed from cache when the
# Chocolatey infrastructure is unavailable.
choco install -y winflexbison3
if($LastExitCode -ne 0)
{
Write-Output "::error ::Dependency installation via Chocolatey failed."
exit $LastExitCode
}
}
else
{
Write-Output "winflexbison3 restored from cache; skipping Chocolatey install."
}
Require-Tool win_flex
Require-Tool win_bison
nuget install clcache -OutputDirectory "c:\tools" -ExcludeVersion -Version 4.1.0
echo "c:\tools\clcache\clcache-4.1.0" >> $env:GITHUB_PATH
- name: Setup code sign environment
run: |
dotnet tool install --global AzureSignTool --version 5.0.0
echo "$(Split-Path -Path $(Get-ChildItem -Path "${env:ProgramFiles(x86)}\Windows Kits\10\App Certification Kit\signtool.exe"))" >> $env:GITHUB_PATH
- name: Restore ccache
id: restore-ccache
uses: actions/cache/restore@v6
with:
path: .ccache
key: ${{ runner.os }}-msbuild-${{ github.ref }}-${{ github.sha }}-RELEASEPKG
restore-keys: |
${{ runner.os }}-msbuild-${{ github.ref }}
${{ runner.os }}-msbuild
- name: ccache environment
run: |
echo "CLCACHE_BASEDIR=$((Get-Item -Path '.\').FullName)" >> $env:GITHUB_ENV
echo "CLCACHE_DIR=$pwd\.ccache" >> $env:GITHUB_ENV
- name: Configure with cmake
run: cmake -S . -B build
- name: Build Release
run: cmake --build build --config Release -- /p:UseMultiToolTask=true /p:CLToolExe=clcache
- name: Print ccache stats
run: clcache -s
- name: Create packages
id: create_packages
# We need to get the path to cpack because fascinatingly,
# chocolatey also includes a command called "cpack" which takes precedence
run: |
Set-Location build
$cpack = "$(Split-Path -Parent (Get-Command cmake).Source)\cpack.exe"
& $cpack . -C Release
$msi_name = Get-ChildItem -Filter *.msi -Name
echo "msi_installer=build/$msi_name" >> $env:GITHUB_OUTPUT
echo "msi_name=$msi_name" >> $env:GITHUB_OUTPUT
- name: Sign the installer
id: code_sign
run: |
$servers = @('http://ts.ssl.com', 'http://timestamp.digicert.com', 'http://timestamp.sectigo.com')
foreach($ts_server in $servers)
{
& AzureSignTool sign `
--azure-key-vault-url "${{ secrets.AZURE_KEYVAULT_URL }}" `
--azure-key-vault-client-id "${{ secrets.AZURE_CLIENT_ID }}" `
--azure-key-vault-tenant-id "${{ secrets.AZURE_TENANT_ID }}" `
--azure-key-vault-client-secret "${{ secrets.AZURE_CLIENT_SECRET }}" `
--azure-key-vault-certificate "${{ secrets.AZURE_CERTIFICATE_NAME }}" `
--timestamp-rfc3161 $ts_server `
--timestamp-digest sha256 `
--file-digest sha256 `
--verbose ${{ steps.create_packages.outputs.msi_installer }}
if ($LastExitCode -eq "0")
{
# Stop if code-signing the binary using this server was successful.
break
}
}
- name: Verify installer signature
id: verify_codesign
run: |
& signtool.exe verify /pa ${{ steps.create_packages.outputs.msi_installer }}
- name: Upload binary packages
uses: softprops/action-gh-release@v3
with:
files: ${{ steps.create_packages.outputs.msi_installer }}
- name: Save ccache
if: always()
uses: actions/cache/save@v6
with:
path: .ccache
key: ${{ steps.restore-ccache.outputs.cache-primary-key }}
push-docker-image-ghcr:
runs-on: ubuntu-24.04
# Release images are published to the GitHub Container Registry, which is free
# for public packages and needs no Docker Hub credentials. Publishing requires
# packages:write on the built-in GITHUB_TOKEN.
permissions:
contents: read
packages: write
steps:
- name: Checkout CBMC source
uses: actions/checkout@v7
with:
submodules: recursive
- name: Set Image Tag
run: |
# Isolate the version number from a reference to a tag, for example,
# '5.20.3' from a string like 'refs/tags/cbmc-5.20.3-exp'
VERSION=$(echo ${{ github.ref }} | cut -d "/" -f 3 | cut -d "-" -f 2)
echo "IMAGE_TAG=ghcr.io/diffblue/cbmc:$VERSION" >> $GITHUB_ENV
- name: Build docker image
run: docker build -t "$IMAGE_TAG" .
- name: Push docker image to GitHub Container Registry
run: |
# Login uses the built-in GITHUB_TOKEN via github.actor, so no secrets
# are needed.
echo "${{ github.token }}" | docker login ghcr.io --username "${{ github.actor }}" --password-stdin
docker image push "$IMAGE_TAG"
# For security reasons remove stored login credentials from
# configuration file they are stored at by docker login.
docker logout ghcr.io