freebsd build #64
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: freebsd build | |
on: | |
workflow_call: | |
workflow_dispatch: | |
env: | |
BUILD_ARCHS: "x86_64-bsd" | |
BUILD_TYPES: ${{ (github.ref_name == 'develop' || github.ref_name == 'main') && 'release debug' || 'release' }} | |
BUILD_TESTING: ${{ (github.ref_name != 'main') && 'testing' || '' }} | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Prepare freebsd build environment | |
run: | | |
sudo mkdir -p /build | |
sudo chown $USER:$USER /build | |
mkdir -p /build/freebsd | |
mkdir -p /build/lib | |
curl -L https://github.com/nzbgetcom/build-files/releases/download/v1.0/freebsd-sysroot.tar.gz -o /build/freebsd/sysroot.tar.gz | |
curl -L https://github.com/nzbgetcom/build-files/releases/download/v1.0/lib-x86_64-bsd.tar.gz -o /build/lib/lib.tar.gz | |
tar zxf /build/freebsd/sysroot.tar.gz -C /build/freebsd | |
tar zxf /build/lib/lib.tar.gz -C /build/lib | |
sudo apt-get update | |
sudo apt-get install -y autoconf automake bc build-essential cmake cpio curl file git libtool pkg-config rsync unzip wget libtinfo6 clang-14 | |
- name: Build | |
run: bash linux/build-nzbget.sh bin installer ${{ env.BUILD_ARCHS }} ${{ env.BUILD_TYPES }} ${{ env.BUILD_TESTING }} | |
- name: Upload full build log on failure | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: nzbget-freebsd-build-log | |
path: build/*/build.log | |
retention-days: 5 | |
- name: Rename build artifacts | |
if: github.ref_name != 'main' && github.ref_name != 'develop' | |
run: | | |
cd build | |
SUFFIX="-${GITHUB_REF_NAME/\//-}-bin-freebsd" | |
for FILE in *.run; do | |
[ -f $FILE ] || continue | |
NEW_FILE=${FILE/-bin-freebsd/$SUFFIX} | |
mv $FILE $NEW_FILE | |
done | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nzbget-freebsd-installers | |
path: build/*.run | |
retention-days: 5 |