forked from diffblue/cbmc
-
Notifications
You must be signed in to change notification settings - Fork 2
306 lines (301 loc) · 12.9 KB
/
release-packages.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
on:
release:
types: [created]
env:
cvc5-version: "1.0.0"
name: Upload additional release assets
jobs:
ubuntu-22_04-package:
runs-on: ubuntu-22.04
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
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: Download cvc-5 from the releases page and make sure it can be deployed
run: |
wget -O cvc5 https://github.com/cvc5/cvc5/releases/download/cvc5-${{env.cvc5-version}}/cvc5-Linux
chmod u+x cvc5
mv cvc5 /usr/local/bin
cvc5 --version
- name: Prepare ccache
uses: actions/cache@v3
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 -j2
- name: Print ccache stats
run: ccache -s
- name: Run CTest
run: cd build; ctest . -V -L CORE -C Release -j2
- 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: Get release info
id: get_release_info
uses: bruceadams/[email protected]
- name: Upload binary packages
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: ${{ steps.create_packages.outputs.deb_package }}
asset_name: ${{ steps.create_packages.outputs.deb_package_name }}
asset_content_type: application/x-deb
- name: Slack notification of CI status
uses: rtCamp/action-slack-notify@v2
if: success() || failure()
env:
SLACK_CHANNEL: team_open_source
SLACK_COLOR: ${{ job.status }}
SLACK_USERNAME: Github Actions CI bot
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_MESSAGE: "${{ job.status == 'success' && 'Ubuntu 22.04 package built and uploaded successfully' || 'Ubuntu 22.04 package build failed' }}"
ubuntu-20_04-package:
runs-on: ubuntu-20.04
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
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: Download cvc-5 from the releases page and make sure it can be deployed
run: |
wget -O cvc5 https://github.com/cvc5/cvc5/releases/download/cvc5-${{env.cvc5-version}}/cvc5-Linux
chmod u+x cvc5
mv cvc5 /usr/local/bin
cvc5 --version
- name: Prepare ccache
uses: actions/cache@v3
with:
path: .ccache
key: ${{ runner.os }}-20.04-Release-${{ github.ref }}-${{ github.sha }}-RELEASEPKG
restore-keys: |
${{ runner.os }}-20.04-Release-${{ github.ref }}
${{ runner.os }}-20.04-Release
- name: ccache environment
run: |
echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV
echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV
- name: Configure CMake
run: |
mkdir build
cd build
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -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 -j2
- name: Print ccache stats
run: ccache -s
- name: Run CTest
run: cd build; ctest . -V -L CORE -C Release -j2
- 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-20.04-$deb_package_name" >> $GITHUB_OUTPUT
- name: Get release info
id: get_release_info
uses: bruceadams/[email protected]
- name: Upload binary packages
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: ${{ steps.create_packages.outputs.deb_package }}
asset_name: ${{ steps.create_packages.outputs.deb_package_name }}
asset_content_type: application/x-deb
- name: Slack notification of CI status
uses: rtCamp/action-slack-notify@v2
if: success() || failure()
env:
SLACK_CHANNEL: team_open_source
SLACK_COLOR: ${{ job.status }}
SLACK_USERNAME: Github Actions CI bot
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_MESSAGE: "${{ job.status == 'success' && 'Ubuntu 20.04 package built and uploaded successfully' || 'Ubuntu 20.04 package build failed' }}"
# homebrew-pr:
# runs-on: macos-11
# steps:
# - name: Get release tag name
# # The GITHUB_REF we get has refs/tags/ in front of the tag name so we
# # strip that here
# run: echo "RELEASE_TAG=${GITHUB_REF/refs\/tags\/}" >> $GITHUB_ENV
# - name: Configure git user name and email
# uses: Homebrew/actions/git-user-config@07da0794847043a11761f14c97cc682577c74d5d
# with:
# username: db-ci-cprover
# - name: Create homebrew PR
# run: |
# brew update-reset
# brew bump-formula-pr --tag "$RELEASE_TAG" --revision "$GITHUB_SHA" cbmc
# env:
# HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.DB_CI_CPROVER_ACCESS_TOKEN }}
# - name: Checkout CBMC project source code to obtain access to scripts
# if: always()
# uses: actions/checkout@v3
# - name: Slack notification of CI status
# if: success() || failure()
# env:
# SLACK_CHANNEL: team_open_source
# SLACK_COLOR: ${{ job.status }}
# SLACK_USERNAME: Github Actions CI bot
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
# SLACK_MESSAGE: "${{ job.status == 'success' && 'Homebrew PR submitted successfully' || 'Homebrew PR failed' }}"
# run: go run scripts/slack_notification_action.go
windows-msi-package:
runs-on: windows-2019
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Visual Studio environment
uses: microsoft/setup-msbuild@v1
- name: Fetch dependencies
run: |
choco install winflexbison3
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: |
echo "$(Split-Path -Path $(Get-ChildItem -Path "${env:ProgramFiles(x86)}\Windows Kits\10\App Certification Kit\signtool.exe"))" >> $env:GITHUB_PATH
echo "pfxcert=$([string](Get-Location)+'\CodeSignCertificate.pfx')" >> $env:GITHUB_ENV
- name: Prepare ccache
uses: actions/cache@v3
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: Decode signing certificate
id: decode_certificate
run: |
$pfx_bytes=[System.Convert]::FromBase64String("${{ secrets.CODESIGNCERTPFX }}")
[IO.File]::WriteAllBytes($env:pfxcert, $pfx_bytes)
- 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)
{
& signtool.exe sign /f $env:pfxcert /p "${{ secrets.CODESIGNCERTPASSWORD }}" /tr $ts_server /td SHA256 /fd SHA256 ${{ steps.create_packages.outputs.msi_installer }}
if ($LastExitCode -eq "0")
{
# Stop if code-signing the binary using this server was successful.
break
}
}
- name: Remove signing certificate
id: remove_certificate
run: |
Remove-Item $env:pfxcert
- name: Verify installer signature
id: verify_codesign
run: |
& signtool.exe verify /pa ${{ steps.create_packages.outputs.msi_installer }}
- name: Get release info
id: get_release_info
uses: bruceadams/[email protected]
- name: Upload binary packages
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: ${{ steps.create_packages.outputs.msi_installer }}
asset_name: ${{ steps.create_packages.outputs.msi_name }}
asset_content_type: application/x-msi
- name: Slack notification of CI status
if: success() || failure()
env:
SLACK_CHANNEL: team_open_source
SLACK_COLOR: ${{ job.status }}
SLACK_USERNAME: Github Actions CI bot
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_MESSAGE: "${{ job.status == 'success' && 'Windows package built and uploaded successfully' || 'Windows package build failed' }}"
run: go run scripts/slack_notification_action.go
# push-docker-image-dockerhub:
# runs-on: ubuntu-20.04
# steps:
# - name: Checkout CBMC source
# uses: actions/checkout@v3
# 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=diffblue/cbmc:$VERSION" >> $GITHUB_ENV
# - name: Build docker image
# run: docker build -t "$IMAGE_TAG" .
# - name: Push docker image to DockerHub
# run: |
# echo ${{ secrets.DOCKERHUB_ACCESS_DB_CI_CPROVER }} | docker login --username=dbcicprover --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
# - name: Slack notification of CI status
# uses: rtCamp/action-slack-notify@v2
# if: success() || failure()
# env:
# SLACK_CHANNEL: team_open_source
# SLACK_COLOR: ${{ job.status }}
# SLACK_USERNAME: Github Actions CI bot
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
# SLACK_MESSAGE: "${{ job.status == 'success' && 'Docker Image built and submitted to DockerHub successfully' || 'Docker Image build failed' }}"