Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Roberto Scolaro <[email protected]>
  • Loading branch information
therealbobo committed Jan 21, 2025
1 parent bee9596 commit b6f082c
Showing 1 changed file with 83 additions and 106 deletions.
189 changes: 83 additions & 106 deletions .github/workflows/release-draft.yaml
Original file line number Diff line number Diff line change
@@ -1,122 +1,99 @@
name: Create Sysdig draft/RC release
on:
pull_request:
branches: [dev]
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]+'
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]+'

jobs:

build-skeleton-sysdig-linux-amd64:
runs-on: ubuntu-latest
build-sysdig-linux:
runs-on: ubuntu-24.04${{ matrix.platform == 'arm64' && '-arm' || '' }}
container:
image: ghcr.io/draios/sysdig-skel-builder:dev
steps:
- name: Checkout Sysdig
uses: actions/checkout@v4
with:
path: sysdig
- name: Link paths
run: |
mkdir -p /source
ln -s "$GITHUB_WORKSPACE/sysdig" /source/sysdig
- name: Prepare build skeleton
run: build cmake-skeleton
- name: Build skeleton
run: build make-skeleton
- name: Cache build skeleton
uses: actions/cache/save@v3
if: always()
id: cache
with:
path: /build-skeleton
key: build-skeleton-${{ github.run_id }}

build-release-linux-amd64:
needs: build-skeleton-sysdig-linux-amd64
runs-on: ubuntu-latest
image: ubuntu:22.04
strategy:
matrix:
platform:
- amd64
- arm64
env:
ZIG_VERSION: 0.14.0-dev.2851+b074fb7dd
BUILD_VERSION: ${{ github.ref_name }}
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
container:
image: ghcr.io/draios/sysdig-builder:dev

steps:
- name: Checkout Sysdig
uses: actions/checkout@v4
with:
path: sysdig
- name: Link paths
fetch-depth: 0

- name: Install deps
run: |

Check warning on line 36 in .github/workflows/release-draft.yaml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] reported by reviewdog 🐶 shellcheck reported issue in this script: SC2046:warning:28:47: Quote this to prevent word splitting [shellcheck] Raw Output: w:.github/workflows/release-draft.yaml:36:9: shellcheck reported issue in this script: SC2046:warning:28:47: Quote this to prevent word splitting [shellcheck]
mkdir -p /source
ln -s "$GITHUB_WORKSPACE/sysdig" /source/sysdig
- name: Restore build skeleton
id: cache
uses: actions/cache/restore@v3
with:
path: /build-skeleton
key: build-skeleton-${{ github.run_id }}
restore-keys: build-skeleton-
- name: Build
run: build cmake
- name: Build packages
run: build package
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: sysdig-release-${{ env.BUILD_VERSION }}-x86_64
path: /build/release/sysdig-${{ env.BUILD_VERSION }}*

build-release-linux-arm64:
runs-on: ubuntu-latest
env:
REGISTRY: ghcr.io
BUILD_VERSION: ${{ github.ref_name }}
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
steps:
- name: Checkout Sysdig
uses: actions/checkout@v4
with:
path: sysdig
- name: Create build dir
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: |
mkdir -p ${{ github.workspace }}/sysdig-build-aarch64
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: 'amd64,arm64'
- name: Run the build skeleton process with Docker
uses: addnab/docker-run-action@v3
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ${{ env.REGISTRY }}
image: ghcr.io/draios/sysdig-skel-builder:dev
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 }}
run: |
mkdir -p /build/release-packages && \
build cmake-skeleton && \
build make-skeleton
- name: Run the build process with Docker
uses: addnab/docker-run-action@v3
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ${{ env.REGISTRY }}
image: ghcr.io/draios/sysdig-builder:dev
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 }}
run: |
mkdir -p /build/release-packages && \
build cmake && \
build package && \
cp /build/release/sysdig-${{ env.BUILD_VERSION }}* /build/release-packages
cmake \
-DUSE_BUNDLED_DEPS=ON \
-DBUILD_BPF=OFF \
-DBUILD_DRIVER=OFF \
-DCMAKE_BUILD_TYPE=Release \
-S . \
-B build \
-G Ninja
cmake --build build --target package --config Release
- name: Upload Artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: sysdig-release-${{ env.BUILD_VERSION }}-aarch64
path: ${{ github.workspace }}/sysdig-build-aarch64/sysdig-${{ env.BUILD_VERSION }}*

name: sysdig-release-${{ env.BUILD_VERSION }}-linux-${{ matrix.platform }}
path: |
build/sysdig-${{ env.BUILD_VERSION }}*
build-release-others-amd64:
name: build-release-others-amd64
strategy:
Expand All @@ -141,7 +118,7 @@ jobs:
cd build && cmake -Wno-dev -DBUILD_DRIVER=OFF -DSYSDIG_VERSION="${{ env.BUILD_VERSION }}" ..
cmake --build . --target package --config Release
- name: Upload Artifacts
uses: actions/upload-artifact@v3
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 }}
Expand All @@ -167,7 +144,7 @@ jobs:
cd build && cmake -Wno-dev -DBUILD_DRIVER=OFF -DSYSDIG_VERSION="${{ env.BUILD_VERSION }}" ..
cmake --build . --target package --config Release
- name: Upload Artifacts
uses: actions/upload-artifact@v3
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 }}
Expand Down Expand Up @@ -245,7 +222,7 @@ jobs:
- name: Check signature
run: test "$(rpm -qpi *.rpm | awk '/Signature/' | grep -i none | wc -l)" -eq 0

Check failure on line 223 in .github/workflows/release-draft.yaml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] reported by reviewdog 🐶 shellcheck reported issue in this script: SC2126:style:1:46: Consider using 'grep -c' instead of 'grep|wc -l' [shellcheck] Raw Output: e:.github/workflows/release-draft.yaml:223:9: shellcheck reported issue in this script: SC2126:style:1:46: Consider using 'grep -c' instead of 'grep|wc -l' [shellcheck]
- name: Upload Signed RPMs
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: sysdig-release-${{ env.BUILD_VERSION }}-${{ matrix.arch }}
path: "*.rpm"
Expand Down Expand Up @@ -282,7 +259,7 @@ jobs:
- name: Check signature
run: dpkg-sig --verify *.deb
- name: Upload Signed DEBs
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: sysdig-release-${{ env.BUILD_VERSION }}-${{ matrix.arch }}
path: "*.deb"
Expand Down

0 comments on commit b6f082c

Please sign in to comment.