mirror of https://github.com/rusefi/rusefi-1.git
61 lines
1.8 KiB
YAML
61 lines
1.8 KiB
YAML
name: Android
|
|
|
|
on: [push,pull_request]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
submodules: recursive
|
|
- uses: actions/setup-java@v1
|
|
with:
|
|
java-version: '8'
|
|
|
|
- name: Test Compiler
|
|
run: javac -version
|
|
|
|
- name: Print GCC version
|
|
working-directory: .
|
|
run: gcc -v
|
|
|
|
- name: Build Native Unit Tests as shared library
|
|
working-directory: ./unit_tests/
|
|
# we have a unit test of JNI thus we need to build shared library
|
|
run: make -j4
|
|
|
|
- name: Build Android
|
|
env:
|
|
RUSEFI_ANDROID_KEYPASS: ${{ secrets.RUSEFI_ANDROID_KEYPASS }}
|
|
working-directory: ./android
|
|
run: |
|
|
if [ "${{github.event_name}}" == "push" ]; then
|
|
bash ./gradlew build
|
|
else
|
|
bash ./gradlew bundleDebug
|
|
fi
|
|
|
|
- name: Upload APK - release
|
|
if: ${{ github.event_name == 'push' }}
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: rusEFI-release
|
|
path: ./android/app/build/outputs/apk/release/rusEFI-release.apk
|
|
|
|
- name: Upload APK - unsigned
|
|
if: ${{ github.event_name != 'push' }}
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: rusEFI-release-unsigned
|
|
path: ./android/app/build/outputs/bundle/debug/rusEFI-debug.aab
|
|
|
|
- name: Install Tools
|
|
run: sudo apt-get install sshpass
|
|
|
|
- name: Upload rusEFI Android application
|
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
|
working-directory: .
|
|
run: java_console/upload_file.sh ${{ secrets.RUSEFI_SSH_USER }} ${{ secrets.RUSEFI_SSH_PASS }} ${{ secrets.RUSEFI_SSH_SERVER }} build_server android/app/build/outputs/apk/release/rusEFI-release.apk
|