Skip to content

Commit

Permalink
feat(build): Consolidate CI/CD
Browse files Browse the repository at this point in the history
Signed-off-by: txtsd <[email protected]>
  • Loading branch information
txtsd committed Sep 6, 2023
1 parent 1f2d074 commit 0ba2d6c
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 71 deletions.
24 changes: 24 additions & 0 deletions .github/scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/ash

# General updates
apk update
apk add cmake openssl openssl-dev openssl-libs-static linux-headers ninja-is-really-ninja alpine-sdk

# Setup build environment
addgroup $(whoami) abuild
mkdir -p /var/cache/distfiles
chmod a+w /var/cache/distfiles
chgrp abuild /var/cache/distfiles
chmod g+w /var/cache/distfiles

# Build static libnl3
abuild-keygen -a -i -b 4096
git clone https://gitlab.alpinelinux.org/alpine/aports.git --depth 1
cd aports/main/libnl3
abuild -r
apk add ~/packages/main/$(abuild -A)/libnl3*

# Build static DPITunnel-cli
cmake -B build -DCMAKE_BUILD_TYPE=RELEASE -DSTATIC_BINARY=true -G Ninja .
cmake --build build

14 changes: 4 additions & 10 deletions .github/workflows/cd.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: CD
name: Build

on:
release:
types: [created]
push:
pull_request:
types: [opened, edited]

jobs:
build:
Expand All @@ -27,17 +29,9 @@ jobs:
run: |
docker run --rm --privileged multiarch/qemu-user-static:register --reset
- name: Setup build environment in Docker
run: |
docker run --workdir /github/workspace --rm --entrypoint "./01_setup_build_env.sh" -v "$(pwd)":"/github/workspace" multiarch/alpine:${{ matrix.arch }}-edge
- name: Build static libnl3 in Docker
run: |
docker run --workdir /github/workspace --rm --entrypoint "./02_build_static_libnl3.sh" -v "$(pwd)":"/github/workspace" multiarch/alpine:${{ matrix.arch }}-edge
- name: Build in Docker
run: |
docker run --workdir /github/workspace --rm --entrypoint "./03_build_static_alpine.sh" -v "$(pwd)":"/github/workspace" multiarch/alpine:${{ matrix.arch }}-edge
docker run --workdir /github/workspace --rm --entrypoint "${{ github.workspace }}/.github/scripts/build.sh" -v "$(pwd)":"/github/workspace" multiarch/alpine:${{ matrix.arch }}-edge
- name: Upload Binary
if: github.event_name != 'release'
Expand Down
36 changes: 0 additions & 36 deletions .github/workflows/ci.yml

This file was deleted.

11 changes: 0 additions & 11 deletions 01_setup_build_env.sh

This file was deleted.

8 changes: 0 additions & 8 deletions 02_build_static_libnl3.sh

This file was deleted.

6 changes: 0 additions & 6 deletions 03_build_static_alpine.sh

This file was deleted.

0 comments on commit 0ba2d6c

Please sign in to comment.