Liftoff app master #39
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: "stable" | |
- name: Disable telemetry | |
run: flutter --disable-analytics | |
- name: Get dependencies | |
run: flutter pub get | |
- name: Generate l10n | |
run: | | |
flutter gen-l10n | |
dart format lib/l10n/gen/ | |
- name: Run lints | |
run: flutter analyze | |
- name: Check formatting | |
run: dart format . | |
- name: Run tests | |
run: flutter test | |
android: | |
name: Android | |
runs-on: ubuntu-latest | |
needs: lint | |
steps: | |
- uses: subosito/[email protected] | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-java@v1 | |
with: | |
java-version: "12.x" | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: "stable" | |
- name: Android build (Pull Request) | |
if: github.event_name == 'pull_request' | |
env: | |
ANDROID_KEY_ALIAS: androiddebugkey | |
ANDROID_KEY_PASSWORD: android | |
ANDROID_STORE_PATH: key.jks | |
ANDROID_STORE_PASSWORD: android | |
run: flutter build apk --split-per-abi --release --target lib/main_prod.dart --flavor preview | |
- name: Inject keystore | |
working-directory: android/app | |
if: github.event_name != 'pull_request' | |
run: | | |
echo "${{ secrets.SIGNING_KEY }}" | base64 -d | tee key.jks >/dev/null | |
- name: Android build (Master Branch) | |
if: github.event_name != 'pull_request' | |
env: | |
ANDROID_KEY_ALIAS: ${{ secrets.ALIAS }} | |
ANDROID_KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
ANDROID_STORE_PATH: key.jks | |
ANDROID_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }} | |
run: flutter build apk --split-per-abi --release --target lib/main_prod.dart --flavor preview | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: android-build | |
path: build/app/outputs/flutter-apk/ | |