2020-10-15 01:59:25 +00:00
|
|
|
name: Android CI
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-04-07 09:17:05 +00:00
|
|
|
- uses: actions/checkout@v4
|
2020-10-15 01:59:25 +00:00
|
|
|
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++
|
2023-06-03 14:41:46 +00:00
|
|
|
- name: Switch to JDK 11
|
|
|
|
run: export JAVA_HOME=$JAVA_HOME_11_X64
|
2023-06-03 14:38:19 +00:00
|
|
|
- name: Install required Android SDK packages
|
2023-06-03 15:09:40 +00:00
|
|
|
run: $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "cmake;3.22.1" "ndk;23.2.8568313"
|
2022-01-27 14:39:30 +00:00
|
|
|
- name: Build required modules
|
|
|
|
run: |
|
2022-12-18 21:26:14 +00:00
|
|
|
export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/23.2.8568313
|
2024-07-21 20:12:40 +00:00
|
|
|
pushd binary/jni
|
2024-07-29 23:25:49 +00:00
|
|
|
./build.sh
|
2022-01-27 14:39:30 +00:00
|
|
|
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
|
2024-04-07 09:17:05 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2020-10-15 02:38:04 +00:00
|
|
|
with:
|
2022-12-18 21:26:14 +00:00
|
|
|
name: android-apks
|
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:
|
2024-04-07 09:17:05 +00:00
|
|
|
- uses: actions/checkout@v4
|
2022-02-21 20:19:55 +00:00
|
|
|
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++
|
2023-06-03 14:41:46 +00:00
|
|
|
- name: Switch to JDK 11
|
|
|
|
run: export JAVA_HOME=$JAVA_HOME_11_X64
|
2023-06-03 14:38:19 +00:00
|
|
|
- name: Install required Android SDK packages
|
2023-06-03 15:09:40 +00:00
|
|
|
run: $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "cmake;3.22.1" "ndk;23.2.8568313"
|
2024-07-29 23:25:49 +00:00
|
|
|
- name: Build binary with NDK
|
2022-02-21 20:19:55 +00:00
|
|
|
run: |
|
2024-07-21 20:12:40 +00:00
|
|
|
export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/23.2.8568313
|
2022-02-21 20:19:55 +00:00
|
|
|
pushd binary/jni
|
2024-07-29 23:25:49 +00:00
|
|
|
./build.sh -b
|
2022-02-21 20:19:55 +00:00
|
|
|
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
|
2024-04-07 09:17:05 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2022-02-21 20:19:55 +00:00
|
|
|
with:
|
2022-12-18 21:26:14 +00:00
|
|
|
name: android-binaries
|
2022-02-21 20:19:55 +00:00
|
|
|
path: binary/libs/*
|
2022-04-29 10:04:45 +00:00
|
|
|
- name: Upload binaries package
|
2024-04-07 09:17:05 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2022-04-29 10:04:45 +00:00
|
|
|
with:
|
2022-12-18 21:26:14 +00:00
|
|
|
name: android-binaries-pack
|
2022-04-29 12:29:27 +00:00
|
|
|
path: contrib/binary_pack/i2pd_*_android_binary.zip
|