-
Notifications
You must be signed in to change notification settings - Fork 733
326 lines (303 loc) · 9.4 KB
/
release-draft.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
name: Create Sysdig draft/RC release
on:
pull_request:
branches: [dev]
push:
branches: [dev]
workflow_dispatch:
#on:
# push:
# tags:
# - '[0-9]+.[0-9]+.[0-9]+'
# - '[0-9]+.[0-9]+.[0-9]+-[a-z]+'
# - '[0-9]+.[0-9]+.[0-9]+-[a-z]+[0-9]+'
env:
BUILD_VERSION: 0.1.1
#BUILD_VERSION: ${{ github.ref_name }}
jobs:
build-release-linux:
runs-on: ubuntu-24.04${{ matrix.platform == 'arm64' && '-arm' || '' }}
container:
image: ubuntu:22.04
strategy:
matrix:
platform:
- amd64
- arm64
include:
- platform: amd64
base_arch: x86_64
release_arch: x86_64
- platform: arm64
base_arch: aarch64
release_arch: aarch64
env:
ZIG_VERSION: 0.14.0-dev.2851+b074fb7dd
steps:
- name: Checkout Sysdig
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install deps
run: |
cp -v scripts/zig-cc /usr/bin/
cp -v scripts/zig-c++ /usr/bin/
apt update && \
apt install -y --no-install-recommends \
autoconf \
automake \
build-essential \
ca-certificates \
clang \
cmake \
curl \
git \
libelf-dev \
libtool \
llvm \
ninja-build \
pkg-config \
rpm \
wget \
xz-utils && \
git clone https://github.com/libbpf/bpftool.git --branch v7.3.0 --single-branch && \
cd bpftool && \
git submodule update --init && \
cd src && \
make install && \
cd ../.. && \
rm -fr bpftool && \
curl -LO https://ziglang.org/builds/zig-linux-$(uname -m)-${ZIG_VERSION}.tar.xz && \
tar -xaf zig-linux-$(uname -m)-${ZIG_VERSION}.tar.xz && \
rm -v zig-linux-$(uname -m)-${ZIG_VERSION}.tar.xz && \
cd zig-linux-$(uname -m)-${ZIG_VERSION} && \
cp -v zig /usr/bin && \
find lib -exec cp --parents {} /usr/ \; && \
cd .. && \
rm -fr zig*
- name: Build Sysdig
env:
CC: zig-cc
CXX: zig-c++
AR: zig ar
RANLIB: zig ranlib
run: |
cmake \
-DUSE_BUNDLED_DEPS=ON \
-DBUILD_BPF=OFF \
-DBUILD_DRIVER=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="/usr" \
-DSYSDIG_VERSION="${{ env.BUILD_VERSION }}" \
-Wno-dev \
-S . \
-B build \
-G Ninja
cmake --build build --target package --config Release
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: sysdig-release-${{ env.BUILD_VERSION }}-${{ matrix.release_arch }}
path: |
build/sysdig-${{ env.BUILD_VERSION }}*
build-release-others-amd64:
name: build-release-others-amd64
strategy:
matrix:
os: [windows-latest, macos-13]
include:
- os: windows-latest
artifact_name: win
artifact_ext: exe
- os: macos-13
artifact_name: osx
artifact_ext: dmg
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Sysdig
uses: actions/checkout@v4
- name: Build
run: |
cmake \
-Wno-dev \
-DBUILD_DRIVER=OFF \
-DSYSDIG_VERSION="${{ env.BUILD_VERSION }}" \
-S . \
-B build
cmake --build build --target package --config Release
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: sysdig-release-${{ env.BUILD_VERSION }}-${{ matrix.artifact_name }}-x86_64
path: build/sysdig-${{ env.BUILD_VERSION }}*.${{ matrix.artifact_ext }}
build-release-others-arm64:
name: build-release-others-arm64
strategy:
matrix:
os: [macos-14]
include:
- os: macos-14
artifact_name: osx
artifact_ext: dmg
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Sysdig
uses: actions/checkout@v4
- name: Build
run: |
cmake \
-Wno-dev \
-DBUILD_DRIVER=OFF \
-DSYSDIG_VERSION="${{ env.BUILD_VERSION }}" \
-S . \
-B build
cmake --build build --target package --config Release
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: sysdig-release-${{ env.BUILD_VERSION }}-${{ matrix.artifact_name }}-arm64
path: build/sysdig-${{ env.BUILD_VERSION }}*.${{ matrix.artifact_ext }}
push-container-image:
runs-on: ubuntu-24.04${{ matrix.platform == 'arm64' && '-arm' || '' }}
container:
image: ubuntu:22.04
strategy:
matrix:
platform:
- amd64
- arm64
include:
- platform: amd64
base_arch: x86_64
release_arch: x86_64
- platform: arm64
base_arch: aarch64
release_arch: aarch64
needs: [build-release-linux, sign-rpms, sign-debs]
env:
REGISTRY: ghcr.io
SYSDIG_IMAGE_BASE: ghcr.io/draios/sysdig
steps:
- name: Checkout Sysdig
uses: actions/checkout@v4
- name: Download artifacts aarch64
uses: actions/download-artifact@v4
with:
name: sysdig-release-${{ env.BUILD_VERSION }}-aarch64
- name: Download artifacts x86_64
uses: actions/download-artifact@v4
with:
name: sysdig-release-${{ env.BUILD_VERSION }}-x86_64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Github Packages
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push container images
uses: docker/build-push-action@v6
with:
file: docker/sysdig/Dockerfile
context: .
tags: ${{ env.SYSDIG_IMAGE_BASE }}:${{ env.BUILD_VERSION }}-draft
push: true
build-args:
BUILD_VERSION=${{ env.BUILD_VERSION }}
sign-rpms:
strategy:
matrix:
name: [amd64, arm64]
include:
- name: amd64
arch: x86_64
- name: arm64
arch: aarch64
needs: build-release-linux
runs-on: ubuntu-latest
env:
KEY_ID: EC51E8C4
container:
image: fedora:39
steps:
- name: Install deps
run: dnf install -y rpm-sign pinentry
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: sysdig-release-${{ env.BUILD_VERSION }}-${{ matrix.arch }}
- name: Import private key
env:
PRIVATE_KEY: ${{ secrets.SYSDIG_REPO_SIGNING_KEY }}
run: printenv PRIVATE_KEY | gpg --import -
- name: Sign RPMs
run: rpm --define "_gpg_name ${{ env.KEY_ID }}" --define "_binary_filedigest_algorithm 8" --addsign *.rpm
- name: Check signature
run: test "$(rpm -qpi *.rpm | awk '/Signature/' | grep -i none | wc -l)" -eq 0
- name: Upload Signed RPMs
uses: actions/upload-artifact@v4
with:
name: sysdig-release-${{ env.BUILD_VERSION }}-${{ matrix.arch }}
path: "*.rpm"
sign-debs:
runs-on: ubuntu-latest
strategy:
matrix:
name: [amd64, arm64]
include:
- name: amd64
arch: x86_64
- name: arm64
arch: aarch64
needs: build-release-linux
env:
KEY_ID: EC51E8C4
container:
image: debian:bullseye-slim
steps:
- name: Install deps
run: apt-get update && apt-get -y install dpkg-sig
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: sysdig-release-${{ env.BUILD_VERSION }}-${{ matrix.arch }}
- name: Import private key
env:
PRIVATE_KEY: ${{ secrets.SYSDIG_REPO_SIGNING_KEY }}
run: printenv PRIVATE_KEY | gpg --import -
- name: Sign DEBs
run: dpkg-sig -k ${{ env.KEY_ID }} -s builder *.deb
- name: Check signature
run: dpkg-sig --verify *.deb
- name: Upload Signed DEBs
uses: actions/upload-artifact@v4
with:
name: sysdig-release-${{ env.BUILD_VERSION }}-${{ matrix.arch }}
path: "*.deb"
create-draft-release:
runs-on: ubuntu-latest
needs: [push-container-image, build-release-linux, sign-rpms, sign-debs]
steps:
- name: Download artifacts (linux-amd64)
uses: actions/download-artifact@v4
with:
name: sysdig-release-${{ env.BUILD_VERSION }}-x86_64
- name: Download artifacts (linux-arm64)
uses: actions/download-artifact@v4
with:
name: sysdig-release-${{ env.BUILD_VERSION }}-aarch64
- name: Download artifacts (win-amd64)
uses: actions/download-artifact@v4
with:
name: sysdig-release-${{ env.BUILD_VERSION }}-win-x86_64
- name: Download artifacts (osx-amd64)
uses: actions/download-artifact@v4
with:
name: sysdig-release-${{ env.BUILD_VERSION }}-osx-x86_64
- name: Create draft release
uses: softprops/action-gh-release@v1
with:
files: |
sysdig-${{ env.BUILD_VERSION }}*
draft: true