Skip to content

Commit c2463f9

Browse files
committed
wip
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
1 parent bee9596 commit c2463f9

File tree

1 file changed

+84
-107
lines changed

1 file changed

+84
-107
lines changed

.github/workflows/release-draft.yaml

Lines changed: 84 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,122 +1,99 @@
11
name: Create Sysdig draft/RC release
22
on:
3+
pull_request:
4+
branches: [dev]
35
push:
4-
tags:
5-
- '[0-9]+.[0-9]+.[0-9]+'
6-
- '[0-9]+.[0-9]+.[0-9]+-[a-z]+'
7-
- '[0-9]+.[0-9]+.[0-9]+-[a-z]+[0-9]+'
6+
branches: [dev]
7+
workflow_dispatch:
8+
#on:
9+
# push:
10+
# tags:
11+
# - '[0-9]+.[0-9]+.[0-9]+'
12+
# - '[0-9]+.[0-9]+.[0-9]+-[a-z]+'
13+
# - '[0-9]+.[0-9]+.[0-9]+-[a-z]+[0-9]+'
814

915
jobs:
10-
11-
build-skeleton-sysdig-linux-amd64:
12-
runs-on: ubuntu-latest
16+
build-release-sysdig-linux:
17+
runs-on: ubuntu-24.04${{ matrix.platform == 'arm64' && '-arm' || '' }}
1318
container:
14-
image: ghcr.io/draios/sysdig-skel-builder:dev
15-
steps:
16-
- name: Checkout Sysdig
17-
uses: actions/checkout@v4
18-
with:
19-
path: sysdig
20-
- name: Link paths
21-
run: |
22-
mkdir -p /source
23-
ln -s "$GITHUB_WORKSPACE/sysdig" /source/sysdig
24-
- name: Prepare build skeleton
25-
run: build cmake-skeleton
26-
- name: Build skeleton
27-
run: build make-skeleton
28-
- name: Cache build skeleton
29-
uses: actions/cache/save@v3
30-
if: always()
31-
id: cache
32-
with:
33-
path: /build-skeleton
34-
key: build-skeleton-${{ github.run_id }}
35-
36-
build-release-linux-amd64:
37-
needs: build-skeleton-sysdig-linux-amd64
38-
runs-on: ubuntu-latest
19+
image: ubuntu:22.04
20+
strategy:
21+
matrix:
22+
platform:
23+
- amd64
24+
- arm64
3925
env:
26+
ZIG_VERSION: 0.14.0-dev.2851+b074fb7dd
4027
BUILD_VERSION: ${{ github.ref_name }}
41-
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
42-
container:
43-
image: ghcr.io/draios/sysdig-builder:dev
28+
4429
steps:
4530
- name: Checkout Sysdig
4631
uses: actions/checkout@v4
4732
with:
48-
path: sysdig
49-
- name: Link paths
33+
fetch-depth: 0
34+
35+
- name: Install deps
5036
run: |
51-
mkdir -p /source
52-
ln -s "$GITHUB_WORKSPACE/sysdig" /source/sysdig
53-
- name: Restore build skeleton
54-
id: cache
55-
uses: actions/cache/restore@v3
56-
with:
57-
path: /build-skeleton
58-
key: build-skeleton-${{ github.run_id }}
59-
restore-keys: build-skeleton-
60-
- name: Build
61-
run: build cmake
62-
- name: Build packages
63-
run: build package
64-
- name: Upload Artifacts
65-
uses: actions/upload-artifact@v3
66-
with:
67-
name: sysdig-release-${{ env.BUILD_VERSION }}-x86_64
68-
path: /build/release/sysdig-${{ env.BUILD_VERSION }}*
69-
70-
build-release-linux-arm64:
71-
runs-on: ubuntu-latest
72-
env:
73-
REGISTRY: ghcr.io
74-
BUILD_VERSION: ${{ github.ref_name }}
75-
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
76-
steps:
77-
- name: Checkout Sysdig
78-
uses: actions/checkout@v4
79-
with:
80-
path: sysdig
81-
- name: Create build dir
37+
cp -v scripts/zig-cc /usr/bin/
38+
cp -v scripts/zig-c++ /usr/bin/
39+
apt update && \
40+
apt install -y --no-install-recommends \
41+
autoconf \
42+
automake \
43+
build-essential \
44+
ca-certificates \
45+
clang \
46+
cmake \
47+
curl \
48+
git \
49+
libelf-dev \
50+
libtool \
51+
llvm \
52+
ninja-build \
53+
pkg-config \
54+
rpm \
55+
wget \
56+
xz-utils && \
57+
git clone https://github.com/libbpf/bpftool.git --branch v7.3.0 --single-branch && \
58+
cd bpftool && \
59+
git submodule update --init && \
60+
cd src && \
61+
make install && \
62+
cd ../.. && \
63+
rm -fr bpftool && \
64+
curl -LO https://ziglang.org/builds/zig-linux-$(uname -m)-${ZIG_VERSION}.tar.xz && \
65+
tar -xaf zig-linux-$(uname -m)-${ZIG_VERSION}.tar.xz && \
66+
rm -v zig-linux-$(uname -m)-${ZIG_VERSION}.tar.xz && \
67+
cd zig-linux-$(uname -m)-${ZIG_VERSION} && \
68+
cp -v zig /usr/bin && \
69+
find lib -exec cp --parents {} /usr/ \; && \
70+
cd .. && \
71+
rm -fr zig*
72+
73+
- name: Build Sysdig
74+
env:
75+
CC: zig-cc
76+
CXX: zig-c++
77+
AR: zig ar
78+
RANLIB: zig ranlib
8279
run: |
83-
mkdir -p ${{ github.workspace }}/sysdig-build-aarch64
84-
- name: Set up QEMU
85-
uses: docker/setup-qemu-action@v3
86-
with:
87-
platforms: 'amd64,arm64'
88-
- name: Run the build skeleton process with Docker
89-
uses: addnab/docker-run-action@v3
90-
with:
91-
username: ${{ github.actor }}
92-
password: ${{ secrets.GITHUB_TOKEN }}
93-
registry: ${{ env.REGISTRY }}
94-
image: ghcr.io/draios/sysdig-skel-builder:dev
95-
options: --platform=linux/arm64 -v ${{ github.workspace }}/sysdig:/source/sysdig -v ${{ github.workspace }}/sysdig-build-aarch64:/build/release-packages -v ${{ github.workspace }}/skeleton-build:/build-skeleton -e BUILD_VERSION=${{ env.BUILD_VERSION }}
96-
run: |
97-
mkdir -p /build/release-packages && \
98-
build cmake-skeleton && \
99-
build make-skeleton
100-
- name: Run the build process with Docker
101-
uses: addnab/docker-run-action@v3
102-
with:
103-
username: ${{ github.actor }}
104-
password: ${{ secrets.GITHUB_TOKEN }}
105-
registry: ${{ env.REGISTRY }}
106-
image: ghcr.io/draios/sysdig-builder:dev
107-
options: --platform=linux/arm64 -v ${{ github.workspace }}/sysdig:/source/sysdig -v ${{ github.workspace }}/sysdig-build-aarch64:/build/release-packages -v ${{ github.workspace }}/skeleton-build:/build-skeleton -e BUILD_VERSION=${{ env.BUILD_VERSION }}
108-
run: |
109-
mkdir -p /build/release-packages && \
110-
build cmake && \
111-
build package && \
112-
cp /build/release/sysdig-${{ env.BUILD_VERSION }}* /build/release-packages
80+
cmake \
81+
-DUSE_BUNDLED_DEPS=ON \
82+
-DBUILD_BPF=OFF \
83+
-DBUILD_DRIVER=OFF \
84+
-DCMAKE_BUILD_TYPE=Release \
85+
-S . \
86+
-B build \
87+
-G Ninja
88+
cmake --build build --target package --config Release
11389
11490
- name: Upload Artifacts
115-
uses: actions/upload-artifact@v3
91+
uses: actions/upload-artifact@v4
11692
with:
117-
name: sysdig-release-${{ env.BUILD_VERSION }}-aarch64
118-
path: ${{ github.workspace }}/sysdig-build-aarch64/sysdig-${{ env.BUILD_VERSION }}*
119-
93+
name: sysdig-release-${{ env.BUILD_VERSION }}-linux-${{ matrix.platform }}
94+
path: |
95+
build/sysdig-${{ env.BUILD_VERSION }}*
96+
12097
build-release-others-amd64:
12198
name: build-release-others-amd64
12299
strategy:
@@ -141,7 +118,7 @@ jobs:
141118
cd build && cmake -Wno-dev -DBUILD_DRIVER=OFF -DSYSDIG_VERSION="${{ env.BUILD_VERSION }}" ..
142119
cmake --build . --target package --config Release
143120
- name: Upload Artifacts
144-
uses: actions/upload-artifact@v3
121+
uses: actions/upload-artifact@v4
145122
with:
146123
name: sysdig-release-${{ env.BUILD_VERSION }}-${{ matrix.artifact_name }}-x86_64
147124
path: build/sysdig-${{ env.BUILD_VERSION }}*.${{ matrix.artifact_ext }}
@@ -167,14 +144,14 @@ jobs:
167144
cd build && cmake -Wno-dev -DBUILD_DRIVER=OFF -DSYSDIG_VERSION="${{ env.BUILD_VERSION }}" ..
168145
cmake --build . --target package --config Release
169146
- name: Upload Artifacts
170-
uses: actions/upload-artifact@v3
147+
uses: actions/upload-artifact@v4
171148
with:
172149
name: sysdig-release-${{ env.BUILD_VERSION }}-${{ matrix.artifact_name }}-arm64
173150
path: build/sysdig-${{ env.BUILD_VERSION }}*.${{ matrix.artifact_ext }}
174151

175152
push-container-image:
176153
runs-on: ubuntu-latest
177-
needs: [build-release-linux-amd64, build-release-linux-arm64, sign-rpms, sign-debs]
154+
needs: [build-release-linux, sign-rpms, sign-debs]
178155
env:
179156
BUILD_VERSION: ${{ github.ref_name }}
180157
REGISTRY: ghcr.io
@@ -245,7 +222,7 @@ jobs:
245222
- name: Check signature
246223
run: test "$(rpm -qpi *.rpm | awk '/Signature/' | grep -i none | wc -l)" -eq 0
247224
- name: Upload Signed RPMs
248-
uses: actions/upload-artifact@v3
225+
uses: actions/upload-artifact@v4
249226
with:
250227
name: sysdig-release-${{ env.BUILD_VERSION }}-${{ matrix.arch }}
251228
path: "*.rpm"
@@ -282,7 +259,7 @@ jobs:
282259
- name: Check signature
283260
run: dpkg-sig --verify *.deb
284261
- name: Upload Signed DEBs
285-
uses: actions/upload-artifact@v3
262+
uses: actions/upload-artifact@v4
286263
with:
287264
name: sysdig-release-${{ env.BUILD_VERSION }}-${{ matrix.arch }}
288265
path: "*.deb"

0 commit comments

Comments
 (0)