2020-10-15 01:59:25 +00:00
|
|
|
name: Android CI
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
2020-10-15 02:38:04 +00:00
|
|
|
submodules: 'recursive'
|
2022-05-18 04:20:07 +00:00
|
|
|
- name: Install GNU C++ compiler
|
2022-01-27 14:39:30 +00:00
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
2022-05-18 04:20:07 +00:00
|
|
|
sudo apt-get install -y g++
|
2022-03-30 01:49:52 +00:00
|
|
|
- name: Setup JDK 1.11
|
2020-10-15 01:59:25 +00:00
|
|
|
uses: actions/setup-java@v1
|
|
|
|
with:
|
2022-03-30 01:49:52 +00:00
|
|
|
java-version: 1.11
|
2020-10-15 01:59:25 +00:00
|
|
|
- name: Setup Android SDK
|
2020-10-15 02:38:04 +00:00
|
|
|
uses: maxim-lobanov/setup-android-tools@v1
|
|
|
|
with:
|
|
|
|
packages: |
|
2022-01-28 10:41:57 +00:00
|
|
|
build-tools;31.0.0
|
|
|
|
platforms;android-31
|
2022-04-06 19:29:29 +00:00
|
|
|
ndk;21.4.7075529
|
|
|
|
cmake;3.18.1
|
2020-10-15 02:38:04 +00:00
|
|
|
cache: true
|
2022-01-27 14:39:30 +00:00
|
|
|
- name: Build required modules
|
|
|
|
run: |
|
|
|
|
export ANDROID_SDK_ROOT=$ANDROID_HOME
|
2022-04-06 19:29:29 +00:00
|
|
|
export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/21.4.7075529
|
2022-01-27 14:39:30 +00:00
|
|
|
pushd app/jni
|
|
|
|
./build_boost.sh
|
|
|
|
./build_openssl.sh
|
|
|
|
./build_miniupnpc.sh
|
|
|
|
popd
|
2020-10-15 01:59:25 +00:00
|
|
|
- name: Build with Gradle
|
2020-10-15 02:38:04 +00:00
|
|
|
run: ./gradlew --no-daemon assembleDebug
|
|
|
|
- name: Upload artifacts
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2022-04-29 10:04:45 +00:00
|
|
|
name: android-apks.zip
|
2020-10-15 02:38:04 +00:00
|
|
|
path: app/build/outputs/apk/debug/*.apk
|
2020-10-15 01:59:25 +00:00
|
|
|
|
2022-02-21 20:19:55 +00:00
|
|
|
build-binary:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
submodules: 'recursive'
|
2022-05-18 04:20:07 +00:00
|
|
|
- name: Install GNU C++ compiler
|
2022-02-21 20:19:55 +00:00
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
2022-05-18 04:20:07 +00:00
|
|
|
sudo apt-get install -y g++
|
2022-03-30 01:49:52 +00:00
|
|
|
- name: Setup JDK 1.11
|
2022-02-21 20:19:55 +00:00
|
|
|
uses: actions/setup-java@v1
|
|
|
|
with:
|
2022-03-30 01:49:52 +00:00
|
|
|
java-version: 1.11
|
2022-02-21 20:19:55 +00:00
|
|
|
- name: Setup Android SDK
|
|
|
|
uses: maxim-lobanov/setup-android-tools@v1
|
|
|
|
with:
|
|
|
|
packages: |
|
2022-04-06 19:29:29 +00:00
|
|
|
ndk;21.4.7075529
|
|
|
|
cmake;3.18.1
|
2022-02-21 20:19:55 +00:00
|
|
|
cache: true
|
|
|
|
- name: Build required modules
|
|
|
|
run: |
|
|
|
|
export ANDROID_SDK_ROOT=$ANDROID_HOME
|
2022-04-06 19:29:29 +00:00
|
|
|
export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/21.4.7075529
|
2022-02-21 20:19:55 +00:00
|
|
|
pushd binary/jni
|
|
|
|
./build_boost.sh
|
|
|
|
./build_openssl.sh
|
|
|
|
./build_miniupnpc.sh
|
|
|
|
popd
|
|
|
|
- name: Build binaries with NDK
|
|
|
|
run: |
|
|
|
|
pushd binary/jni
|
|
|
|
$ANDROID_NDK_HOME/ndk-build -j2 NDK_MODULE_PATH=$PWD
|
|
|
|
popd
|
2022-04-29 10:04:45 +00:00
|
|
|
- name: Create package with built binaries
|
|
|
|
run: |
|
|
|
|
pushd contrib/binary_pack
|
|
|
|
./build-archive
|
|
|
|
popd
|
|
|
|
- name: Upload binaries archive
|
2022-02-21 20:19:55 +00:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2022-04-29 10:04:45 +00:00
|
|
|
name: android-binaries.zip
|
2022-02-21 20:19:55 +00:00
|
|
|
path: binary/libs/*
|
2022-04-29 10:04:45 +00:00
|
|
|
- name: Upload binaries package
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: android-binaries-pack.zip
|
2022-04-29 12:29:27 +00:00
|
|
|
path: contrib/binary_pack/i2pd_*_android_binary.zip
|