yubioath-flutter/.github/workflows/android.yaml
2022-04-05 08:56:33 +02:00

71 lines
1.9 KiB
YAML

name: Android
on: [push, pull_request]
jobs:
build-release:
name: Release apk
runs-on: ubuntu-latest
steps:
- name: Checkout Yubikit Next
uses: actions/checkout@v2
with:
repository: Yubico/yubikit-android
ref: next
path: kit
- name: set up JDK 11
uses: actions/setup-java@v1
with:
java-version: '11'
- name: Build Yubikit-android
run: ./gradlew --stacktrace check test build javadocJar publishToMavenLocal
working-directory: ./kit
- name: Install Flutter
uses: subosito/flutter-action@v1
with:
channel: 'beta'
- run: |
flutter config
flutter --version
- uses: actions/checkout@v2
with:
path: 'app'
- name: Run flutter tests
run: |
flutter test
flutter analyze
working-directory: ./app
- name: Build the App
run: flutter build apk --release
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
- name: Run android tests
run: |
./gradlew test
env:
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')
mkdir artifacts
mv build/app/outputs/flutter-apk/app-release.apk artifacts/yubico-authenticator-release-${REF}.apk
working-directory: ./app
- uses: actions/upload-artifact@v2
with:
name: yubico-authenticator-android
path: app/artifacts/*