-
Notifications
You must be signed in to change notification settings - Fork 262
296 lines (267 loc) · 11.5 KB
/
ci-package.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
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
# **********************************************************
# Copyright (c) 2020-2024 Google, Inc. All rights reserved.
# **********************************************************
# Dr. Memory: the memory debugger
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation;
# version 2.1 of the License, and no later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# Github Actions workflow for release packages.
name: ci-package
on:
# Our weekly cronbuild: 9pm EST on Fridays.
schedule:
- cron: '0 2 * * SAT'
# Manual trigger using the Actions page.
workflow_dispatch:
inputs:
version:
description: 'Package version number (blank for cronbuild)'
required: false
default: ''
build:
description: 'Package build number'
required: true
default: '0'
defaults:
run:
shell: bash
jobs:
###########################################################################
# Linux tarball with 64-bit and 32-bit builds:
x86:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Fetch Sources
run: git fetch --no-tags --depth=1 origin master
# Install multilib for non-cross-compiling Linux build.
# GA CI uses packages.microsoft.com which is missing i386 packages, and
# attempts at using apt with us.archive-ubuntu.com hit dep issues:
# so we manually install the libunwind i386 packages we need.
- name: Create Build Environment
run: |
sudo apt-get update
sudo apt-get -y install doxygen jsonlint g++-multilib libunwind-dev \
zlib1g zlib1g-dev
sudo add-apt-repository 'deb [arch=i386] http://us.archive.ubuntu.com/ubuntu focal main'
apt download libunwind8:i386 libunwind-dev:i386 liblzma5:i386 \
zlib1g:i386 zlib1g-dev:i386
mkdir ../extract
for i in *.deb; do dpkg-deb -x $i ../extract; done
# find_package(ZLIB) doesn't find /lib32, yet ld.so seems to need lib32,
# so we do both:
sudo rsync -av ../extract/usr/lib/i386-linux-gnu/ /usr/lib/i386-linux-gnu/
sudo rsync -av ../extract/lib/i386-linux-gnu/ /usr/lib/i386-linux-gnu/
sudo rsync -av ../extract/usr/lib/i386-linux-gnu/ /lib32/
sudo rsync -av ../extract/lib/i386-linux-gnu/ /lib32/
sudo rsync -av ../extract/usr/include/i386-linux-gnu/ /usr/include/
rm *.deb
# Downgrade from cmake 3.20 to avoid 32-bit toolchain problems (DRi#4830).
- name: Downgrade cmake
uses: jwlawson/actions-setup-cmake@v1.8
with:
cmake-version: '3.19.7'
- name: Get Version
id: version
# XXX: For now we duplicate this version number here with CMakeLists.txt.
# We should find a way to share (xref DRi#1565).
# We support setting the version and build for manual builds.
# We only use a non-zero build # when making multiple manual builds in one day.
run: |
if test -z "${{ github.event.inputs.version }}"; then
export VERSION_NUMBER="2.6.$((`git log -n 1 --format=%ct` / (60*60*24)))"
export PREFIX="cronbuild-"
else
export VERSION_NUMBER=${{ github.event.inputs.version }}
export PREFIX="release_"
fi
if [ "${{ github.event.inputs.build }}" -ne 0 ]; then
export VERSION_NUMBER="${VERSION_NUMBER}-${{ github.event.inputs.build }}"
fi
echo "::set-output name=version_number::${VERSION_NUMBER}"
- name: Build Package
working-directory: ${{ github.workspace }}
run: ./tests/runsuite_wrapper.pl travis
env:
CI_TARGET: package
VERSION_NUMBER: ${{ steps.version.outputs.version_number }}
# Docs are deployed separately in ci-docs.yml.
DEPLOY_DOCS: no
- name: Upload Artifacts
# This points to the latest v4.x.x.
uses: actions/upload-artifact@v4
with:
name: linux-tarball
path: DrMemory-Linux-${{ steps.version.outputs.version_number }}.tar.gz
###########################################################################
# Mac tarball with x86-64 build:
# TODO i#2511: re-enable once it works on macos-12.
###########################################################################
# Windows .zip and .msi with 32-bit and 64-bit x86 builds:
windows:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Fetch Sources
run: git fetch --no-tags --depth=1 origin master
- name: Download Packages
shell: powershell
run: |
md c:\projects\install
(New-Object System.Net.WebClient).DownloadFile("https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip", "c:\projects\install\ninja.zip")
(New-Object System.Net.WebClient).DownloadFile("https://sourceforge.net/projects/doxygen/files/rel-1.8.19/doxygen-1.8.19.windows.x64.bin.zip", "c:\projects\install\doxygen.zip")
- name: Get Version
id: version
# XXX: See x86 job comments on sharing the default ver# with CMakeLists.txt.
run: |
if test -z "${{ github.event.inputs.version }}"; then
export VERSION_NUMBER="2.6.$((`git log -n 1 --format=%ct` / (60*60*24)))"
export PREFIX="cronbuild-"
else
export VERSION_NUMBER=${{ github.event.inputs.version }}
export PREFIX="release_"
fi
if [ "${{ github.event.inputs.build }}" -ne 0 ]; then
export VERSION_NUMBER="${VERSION_NUMBER}-${{ github.event.inputs.build }}"
fi
echo "::set-output name=version_number::${VERSION_NUMBER}"
- name: Build Package
working-directory: ${{ github.workspace }}
shell: cmd
run: |
echo ------ Setting up paths ------
7z x c:\projects\install\ninja.zip -oc:\projects\install\ninja > nul
set PATH=c:\projects\install\ninja;%PATH%
7z x c:\projects\install\doxygen.zip -oc:\projects\install\doxygen > nul
set PATH=c:\projects\install\doxygen;%PATH%
dir "c:\Program Files (x86)\WiX Toolset"*
set PATH=C:\Program Files (x86)\WiX Toolset v3.14\bin;%PATH%
call "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars32.bat"
echo ------ Running suite ------
echo PATH is "%PATH%"
echo Running in directory "%CD%"
perl tests/runsuite_wrapper.pl travis use_ninja
env:
CI_TARGET: package
VERSION_NUMBER: ${{ steps.version.outputs.version_number }}
- name: Upload Zip
# This points to the latest v4.x.x.
uses: actions/upload-artifact@v4
with:
name: windows-zip
path: DrMemory-Windows-${{ steps.version.outputs.version_number }}.zip
- name: Upload Msi
# This points to the latest v4.x.x.
uses: actions/upload-artifact@v4
with:
name: windows-msi
path: DrMemory-Windows-${{ steps.version.outputs.version_number }}.msi
###########################################################################
# Create release and populate with files.
# We can't have each OS job create the release because only the first
# succeeds and the others fail: there is no check in the create-release
# action to use an existing release if it already exists.
# Thus, our strategy is to share files from the build jobs with this
# single release job via artifacts.
create_release:
needs: [x86, windows]
runs-on: ubuntu-20.04
steps:
# We need a checkout to run git log for the version.
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Get Version
id: version
# XXX: See x86 job comments on sharing the default ver# with CMakeLists.txt.
run: |
if test -z "${{ github.event.inputs.version }}"; then
export VERSION_NUMBER="2.6.$((`git log -n 1 --format=%ct` / (60*60*24)))"
export OSX_PATCHLEVEL=$((`git log -n 1 --format=%ct` / (60*60*24)))
export OSX_PATCHLEVEL=$(((OSX_PATCHLEVEL % 200) + 56))
export OSX_VERSION_NUMBER="2.6.${OSX_PATCHLEVEL}"
export PREFIX="cronbuild-"
else
export VERSION_NUMBER=${{ github.event.inputs.version }}
export OSX_VERSION_NUMBER=${{ github.event.inputs.version }}
export PREFIX="release_"
fi
if [ "${{ github.event.inputs.build }}" -ne 0 ]; then
export VERSION_NUMBER="${VERSION_NUMBER}-${{ github.event.inputs.build }}"
export OSX_VERSION_NUMBER="${OSX_VERSION_NUMBER}-${{ github.event.inputs.build }}"
fi
echo "::set-output name=version_number::${VERSION_NUMBER}"
echo "::set-output name=osx_version_number::${OSX_VERSION_NUMBER}"
echo "::set-output name=version_string::${PREFIX}${VERSION_NUMBER}"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.version.outputs.version_string }}
release_name: ${{ steps.version.outputs.version_string }}
body: |
Auto-generated periodic build.
draft: false
prerelease: false
- name: Download Linux
# This points to the latest v4.x.x.
uses: actions/download-artifact@v4
with:
name: linux-tarball
- name: Upload Linux
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
# This action doesn't seem to support a glob so we need the exact name.
asset_path: DrMemory-Linux-${{ steps.version.outputs.version_number }}.tar.gz
asset_name: DrMemory-Linux-${{ steps.version.outputs.version_number }}.tar.gz
asset_content_type: application/x-gzip
- name: Download Zip
# This points to the latest v4.x.x.
uses: actions/download-artifact@v4
with:
name: windows-zip
- name: Upload Zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
# This action doesn't seem to support a glob so we need the exact name.
asset_path: DrMemory-Windows-${{ steps.version.outputs.version_number }}.zip
asset_name: DrMemory-Windows-${{ steps.version.outputs.version_number }}.zip
asset_content_type: application/zip
- name: Download Msi
# This points to the latest v4.x.x.
uses: actions/download-artifact@v4
with:
name: windows-msi
- name: Upload Msi
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
# This action doesn't seem to support a glob so we need the exact name.
asset_path: DrMemory-Windows-${{ steps.version.outputs.version_number }}.msi
asset_name: DrMemory-Windows-${{ steps.version.outputs.version_number }}.msi
asset_content_type: application/octet-stream