diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml new file mode 100644 index 000000000..3cdb0c79e --- /dev/null +++ b/.github/workflows/android.yaml @@ -0,0 +1,26 @@ +name: Android + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + name: NDK-R23 + runs-on: ubuntu-18.04 + + steps: + - name: Setup Android NDK R23 + uses: nttld/setup-ndk@v1 + id: setup-ndk + with: + ndk-version: r23 + add-to-path: false + - uses: actions/checkout@v2 + - name: build + run: | + cd ./scripts/build-android/ + echo ${{ steps.setup-ndk.outputs.ndk-path }} + source ./build-android -n ${{ steps.setup-ndk.outputs.ndk-path }} diff --git a/scripts/build-android/build-android b/scripts/build-android/build-android index f2d596847..b1c7363a9 100755 --- a/scripts/build-android/build-android +++ b/scripts/build-android/build-android @@ -10,7 +10,6 @@ echo_help() echo " -e Encryption library to be used. Possible options: openssl (default) mbedtls" echo " -o OpenSSL version. E.g. 1.1.1l" echo " -m Mbed TLS version. E.g. v2.26.0" - echo " -s SRT version. E.g. v1.4.4" echo echo "Example: ./build-android -n /home/username/Android/Sdk/ndk/23.0.7599858 -a 28 -t \"arm64-v8a x86_64\"" echo @@ -21,7 +20,6 @@ NDK_ROOT="" API_LEVEL=28 BUILD_TARGETS="armeabi-v7a arm64-v8a x86 x86_64" OPENSSL_VERSION=1.1.1l -SRT_VERSION="" ENC_LIB=openssl MBEDTLS_VERSION=v2.26.0 @@ -56,10 +54,8 @@ SCRIPT_DIR=$(pwd) HOST_TAG='unknown' unamestr=$(uname -s) if [ "$unamestr" = 'Linux' ]; then - SCRIPT_DIR=$(readlink -f $0 | xargs dirname) HOST_TAG='linux-x86_64' elif [ "$unamestr" = 'Darwin' ]; then - SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) if [ $(uname -p) = 'arm' ]; then echo "NDK does not currently support ARM64" exit 128 @@ -93,12 +89,8 @@ else exit 128 fi -if [ ! -d $BASE_DIR/srt ]; then - git clone https://github.com/Haivision/srt srt - if [ ! -z "$SRT_VERSION" ]; then - git -C $BASE_DIR/srt checkout $SRT_VERSION - fi -fi +# Build working copy of srt repository +REPO_DIR="../.." for build_target in $BUILD_TARGETS; do LIB_DIR=$BASE_DIR/$build_target/lib @@ -113,7 +105,7 @@ for build_target in $BUILD_TARGETS; do cp $LIB_DIR/libmbedx509.so $JNI_DIR/libmbedx509.so fi - git -C $BASE_DIR/srt clean -fd - $SCRIPT_DIR/mksrt -n $NDK_ROOT -a $API_LEVEL -t $build_target -e $ENC_LIB -s $BASE_DIR/srt -i $BASE_DIR/$build_target + git -C $REPO_DIR clean -fd -e scripts + $SCRIPT_DIR/mksrt -n $NDK_ROOT -a $API_LEVEL -t $build_target -e $ENC_LIB -s $REPO_DIR -i $BASE_DIR/$build_target cp $LIB_DIR/libsrt.so $JNI_DIR/libsrt.so done