android build #26
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: android build | |
on: | |
workflow_call: | |
workflow_dispatch: | |
env: | |
BUILD_ARCHS: "aarch64-ndk armhf-ndk i686-ndk x86_64-ndk" | |
BUILD_TYPES: ${{ (github.ref_name == 'develop' || github.ref_name == 'main') && 'release debug' || 'release' }} | |
jobs: | |
build-bin: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
arch: [aarch64-ndk, armhf-ndk, i686-ndk, x86_64-ndk] | |
type: [release, debug] | |
build-only-release: | |
- ${{ github.ref_name != 'develop' && github.ref_name != 'main' }} | |
exclude: | |
- build-only-release: true | |
type: debug | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Prepare ${{ matrix.arch }} / ${{ matrix.type }} environment | |
run: | | |
sudo mkdir -p /build | |
sudo chown $USER:$USER /build | |
mkdir -p /build/android | |
mkdir -p /build/lib | |
curl -L https://github.com/nzbgetcom/build-files/releases/download/v1.0/android-${{ matrix.arch }}.tar.gz -o /build/android/ndk.tar.gz | |
curl -L https://github.com/nzbgetcom/build-files/releases/download/v1.0/lib-${{ matrix.arch }}.tar.gz -o /build/lib/lib.tar.gz | |
tar zxf /build/android/ndk.tar.gz -C /build/android | |
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.arch }} ${{ matrix.type }} bin" | |
if [ "$GITHUB_REF_NAME" != "main" ]; then | |
BUILD_PARAMS="$BUILD_PARAMS testing" | |
fi | |
bash linux/build-nzbget.sh $BUILD_PARAMS | |
- name: Upload full build log on failure | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: nzbget-android-${{ matrix.arch }}-${{ matrix.type }}-build-log | |
path: build/*/build.log | |
retention-days: 5 | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nzbget-${{ matrix.arch }}-${{ matrix.type }}-bin | |
path: build/*.tar.gz | |
retention-days: 5 | |
# - name: Rename build artifacts | |
# if: github.ref_name != 'main' && github.ref_name != 'develop' | |
# run: | | |
# cd build | |
# SUFFIX="-${GITHUB_REF_NAME/\//-}-bin-android.run" | |
# for FILE in *.run; do | |
# [ -f $FILE ] || continue | |
# NEW_FILE=${FILE/-bin-android.run/$SUFFIX} | |
# mv $FILE $NEW_FILE | |
# done | |
# - name: Upload build artifacts | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: nzbget-android-installers | |
# path: build/*.run | |
# retention-days: 5 |