linux build #198
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: linux build | |
on: | |
workflow_call: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- platform: aarch64 | |
- platform: armhf | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Prepare ${{ matrix.platform }} environment | |
run: | | |
sudo mkdir -p /build | |
sudo chown $USER:$USER /build | |
mkdir -p /build/buildroot | |
mkdir -p /build/lib | |
curl -L https://github.nzbget.com/buildroot-${{ matrix.platform }}.tar.gz -o /build/buildroot/buildroot.tar.gz | |
curl -L https://github.nzbget.com/lib-${{ matrix.platform }}.tar.gz -o /build/lib/lib.tar.gz | |
tar zxf /build/buildroot/buildroot.tar.gz -C /build/buildroot | |
tar zxf /build/lib/lib.tar.gz -C /build/lib | |
sudo apt-get install -y autoconf automake bc build-essential cmake cpio curl file git libtool pkg-config rsync unzip wget libtinfo5 | |
- name: Build | |
run: | | |
BUILD_PARAMS="${{ matrix.platform }} bin" | |
if [ "$GITHUB_REF_NAME" == "develop" ] || [ "$GITHUB_REF_NAME" == "main" ]; then | |
BUILD_PARAMS="$BUILD_PARAMS debug release" | |
else | |
BUILD_PARAMS="$BUILD_PARAMS release" | |
fi | |
if [ "$GITHUB_REF_NAME" != "main" ]; then | |
BUILD_PARAMS="$BUILD_PARAMS testing" | |
fi | |
bash linux/build-nzbget.sh $BUILD_PARAMS | |
# - name: Rename build artifacts | |
# if: github.ref_name != 'main' && github.ref_name != 'develop' | |
# run: | | |
# cd build | |
# SUFFIX="-${GITHUB_REF_NAME/\//-}-bin-linux.run" | |
# for FILE in *.run; do | |
# [ -f $FILE ] || continue | |
# NEW_FILE=${FILE/-bin-linux.run/$SUFFIX} | |
# mv $FILE $NEW_FILE | |
# done | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nzbget-${{ matrix.platform }}-bin | |
path: build/*.tar.gz | |
retention-days: 5 |