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 <slendi@socopon.com>
This commit is contained in:
slendi 2023-03-02 12:08:43 +02:00 committed by xSlendiX
parent a350141d45
commit 9a64496c97
No known key found for this signature in database
GPG key ID: D4F62D3533AB5EA1
2 changed files with 49 additions and 2 deletions

47
.github/workflows/build.yml vendored Normal file
View file

@ -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

View file

@ -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