Skip to content

Instantly share code, notes, and snippets.

@malibayram
Created March 10, 2022 18:22
Show Gist options
  • Save malibayram/7f83572d4254954a06e73ca1c23a75b3 to your computer and use it in GitHub Desktop.
Save malibayram/7f83572d4254954a06e73ca1c23a75b3 to your computer and use it in GitHub Desktop.
name: Analyze, build and deploy for Web and Android
on:
push:
branches:
- alpha
pull_request:
branches:
- alpha
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: πŸ“š Git Checkout
uses: actions/checkout@v2
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: "12.x"
- name: 🐦 Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: 2.8.1
channel: stable
cache: true
- name: πŸ“¦ Install Dependencies
run: |
flutter pub global activate very_good_cli
very_good --analytics false
very_good packages get --recursive
- name: ✨ Check Formatting
run: flutter format --set-exit-if-changed lib test
- name: πŸ•΅οΈ Analyze
run: flutter analyze lib test
- name: πŸ§ͺ Run Tests
run: flutter test --no-pub --coverage --test-randomize-ordering-seed random
- name: πŸ“Š Check Code Coverage
uses: VeryGoodOpenSource/[email protected]
with:
min_coverage: 10
- name: Build Web App
run: |
flutter build web -t lib/main_staging.dart
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}"
projectId: oxford5bin
channelId: live
- name: Download Android keystore
id: android_keystore
uses: timheuer/[email protected]
with:
fileName: key.jks
encodedString: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
- name: Create key.properties
run: |
echo "storeFile=${{ steps.android_keystore.outputs.filePath }}" > android/key.properties
echo "storePassword=${{ secrets.ANDROID_KEY_ALIAS }}" >> android/key.properties
echo "keyPassword=${{ secrets.ANDROID_KEY_ALIAS }}" >> android/key.properties
echo "keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}" >> android/key.properties
- name: Build Android App Bundle
run: flutter build appbundle -t lib/main_staging.dart --flavor production
- name: Setup Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: "2.6"
- name: Cache bundle dependencies
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: ${{ runner.os }}-gems-
- name: Download bundle dependencies
run: |
gem install bundler:2.0.2
bundle config path vendor/bundle
bundle install
- name: Release to Google Play (beta)
env:
SUPPLY_PACKAGE_NAME: ${{ secrets.ANDROID_PACKAGE_NAME }}
SUPPLY_JSON_KEY_DATA: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_KEY }}
run: |
bundle exec fastlane supply \
--aab build/app/outputs/bundle/productionRelease/app-production-release.aab \
--track beta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment