From 9a64496c97125e24194894d40602ffec3e321c89 Mon Sep 17 00:00:00 2001 From: slendi Date: Thu, 2 Mar 2023 12:08:43 +0200 Subject: [PATCH] Add GitHub actions build script This patch adds a way to build on pull requests and pushes ISOs each time. This js really convinient for people that do not wish to go through the build process which may be because they cannkt do it for some reason or another. Signed-off-by: slendi --- .github/workflows/build.yml | 47 +++++++++++++++++++++++++++++++++++++ build/build-iso.sh | 4 ++-- 2 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..eeda77ce --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,47 @@ +name: Build Application + +on: + push: + branches-ignore: + - 'stable' + paths-ignore: + - '**.md' + - 'screenshots/**' + - '**/LICENSE' + pull_request: + paths-ignore: + - '**.md' + - 'screenshots/**' + - '**/LICENSE' + workflow_dispatch: + +jobs: + build: + name: Build + runs-on: self-hosted + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: 'true' + + - name: Install Dependencies + run: | + sudo apt-get -y update + sudo apt-get -y install build-essential git xorriso qemu-system-x86 + + - name: Build ISOs + run: | + cd build + ./build-iso.sh --headless + cd .. + + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: ISOs + path: | + build/*.iso + if-no-files-found: error + diff --git a/build/build-iso.sh b/build/build-iso.sh index 7aedcda1..9e477698 100755 --- a/build/build-iso.sh +++ b/build/build-iso.sh @@ -15,8 +15,8 @@ fi [ "$1" = "--headless" ] && QEMU_HEADLESS='-display none' SUDO='none' -command -v doas && $SUDO=doas -command -v sudo&& $SUDO=sudo +command -v doas && SUDO=doas +command -v sudo && SUDO=sudo if [ "$SUDO" = "none" ] ; then echo 'No sudo or doas installed. Cannot proceed.' exit 1