2022-03-09 19:27:24 +03:00
|
|
|
name: Android
|
2022-03-04 14:20:01 +03:00
|
|
|
|
2022-03-16 14:06:02 +03:00
|
|
|
on: [push, pull_request]
|
2022-03-04 14:20:01 +03:00
|
|
|
|
|
|
|
jobs:
|
2022-04-05 09:59:21 +03:00
|
|
|
build:
|
2022-04-04 18:13:01 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: set up JDK 11
|
2022-10-24 09:13:26 +03:00
|
|
|
uses: actions/setup-java@v3
|
2022-04-04 18:13:01 +03:00
|
|
|
with:
|
2022-10-24 09:13:26 +03:00
|
|
|
distribution: 'zulu'
|
2022-04-04 18:13:01 +03:00
|
|
|
java-version: '11'
|
|
|
|
|
|
|
|
- name: Install Flutter
|
2022-04-27 15:42:05 +03:00
|
|
|
uses: subosito/flutter-action@v2
|
2022-04-04 18:13:01 +03:00
|
|
|
with:
|
2022-05-12 09:36:47 +03:00
|
|
|
channel: 'stable'
|
2022-10-06 09:15:31 +03:00
|
|
|
flutter-version: '3.3.4'
|
2022-04-04 18:13:01 +03:00
|
|
|
- run: |
|
|
|
|
flutter config
|
|
|
|
flutter --version
|
|
|
|
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
path: 'app'
|
|
|
|
|
2022-05-13 16:53:19 +03:00
|
|
|
- name: Check app versions
|
|
|
|
run: |
|
|
|
|
python set-version.py
|
|
|
|
git diff --exit-code
|
|
|
|
working-directory: ./app
|
|
|
|
|
2022-04-04 18:13:01 +03:00
|
|
|
- name: Run flutter tests
|
|
|
|
run: |
|
|
|
|
flutter test
|
|
|
|
flutter analyze
|
|
|
|
working-directory: ./app
|
|
|
|
|
2022-08-31 16:49:43 +03:00
|
|
|
- name: Generate Third party licenses
|
|
|
|
run: ./gradlew collectLicenses
|
|
|
|
working-directory: ./app/android
|
|
|
|
|
2022-04-04 18:13:01 +03:00
|
|
|
- name: Build the App
|
2022-09-09 13:03:54 +03:00
|
|
|
run: flutter build apk --release --split-per-abi && flutter build apk --release
|
2022-04-04 18:13:01 +03:00
|
|
|
env:
|
|
|
|
YUBIOATH_STORE_BASE64: ${{ secrets.YUBIOATH_STORE_BASE64 }}
|
|
|
|
YUBIOATH_KEY_ALIAS: ${{ secrets.YUBIOATH_KEY_ALIAS }}
|
|
|
|
YUBIOATH_KEY_PASSWORD: ${{ secrets.YUBIOATH_KEY_PASSWORD }}
|
|
|
|
YUBIOATH_STORE_PASSWORD: ${{ secrets.YUBIOATH_STORE_PASSWORD }}
|
|
|
|
working-directory: ./app
|
|
|
|
|
2022-05-13 16:53:19 +03:00
|
|
|
- name: Check generated files
|
|
|
|
run: git diff --exit-code
|
|
|
|
working-directory: ./app
|
|
|
|
|
2022-04-04 18:13:01 +03:00
|
|
|
- name: Run android tests
|
|
|
|
run: |
|
2022-07-25 13:11:36 +03:00
|
|
|
./gradlew test
|
2022-04-04 18:13:01 +03:00
|
|
|
working-directory: ./app/android
|
|
|
|
|
|
|
|
- name: Upload artifacts
|
|
|
|
run: |
|
|
|
|
export REF=$(echo ${GITHUB_REF} | cut -d '/' -f 3,4,5,6,7 | sed -r 's/\//_/g')
|
2022-09-20 12:32:43 +03:00
|
|
|
export FLUTTER_APK=build/app/outputs/flutter-apk
|
|
|
|
export NATIVE_LIBS=build/app/intermediates/merged_native_libs/release/out/lib
|
|
|
|
|
2022-04-04 18:13:01 +03:00
|
|
|
mkdir artifacts
|
2022-09-20 12:32:43 +03:00
|
|
|
mv "${FLUTTER_APK}/app-arm64-v8a-release.apk" artifacts/yubico-authenticator-arm64-v8a-${REF}.apk
|
|
|
|
mv "${FLUTTER_APK}/app-armeabi-v7a-release.apk" artifacts/yubico-authenticator-armeabi-v7a-${REF}.apk
|
|
|
|
mv "${FLUTTER_APK}/app-x86_64-release.apk" artifacts/yubico-authenticator-x86_64-${REF}.apk
|
|
|
|
mv "${FLUTTER_APK}/app-release.apk" artifacts/yubico-authenticator-${REF}.apk
|
|
|
|
|
2022-09-20 11:27:18 +03:00
|
|
|
mv build/app/outputs/mapping/release/mapping.txt artifacts/
|
2022-09-20 12:32:43 +03:00
|
|
|
|
2022-09-20 12:58:55 +03:00
|
|
|
pushd "${NATIVE_LIBS}/"
|
2022-09-20 12:17:00 +03:00
|
|
|
zip -r sym-arm64-v8a.zip arm64-v8a/*so
|
|
|
|
zip -r sym-armeabi-v7a.zip armeabi-v7a/*so
|
|
|
|
zip -r sym-x86_64.zip x86_64/*so
|
|
|
|
popd
|
2022-09-20 13:39:32 +03:00
|
|
|
mv "${NATIVE_LIBS}/"*zip artifacts/
|
2022-04-04 18:13:01 +03:00
|
|
|
working-directory: ./app
|
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: yubico-authenticator-android
|
|
|
|
path: app/artifacts/*
|