From 97b77938053c1d51b16a84da92260e685b12dc4f Mon Sep 17 00:00:00 2001 From: kolaente Date: Mon, 11 Oct 2021 21:55:14 +0200 Subject: [PATCH] feat(ci): add release apk build --- .github/workflows/flutter-release.yml | 53 +++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/flutter-release.yml diff --git a/.github/workflows/flutter-release.yml b/.github/workflows/flutter-release.yml new file mode 100644 index 0000000..b50f630 --- /dev/null +++ b/.github/workflows/flutter-release.yml @@ -0,0 +1,53 @@ +# Based on https://medium.com/flutter-community/automating-publishing-your-flutter-apps-to-google-play-using-github-actions-2f67ac582032 + +name: Flutter release + +on: + release: + types: [published] + +jobs: + release: + name: Test, build and release runs-on: ubuntu-latest steps: + - name: Checkout + uses: actions/checkout@v1 + + - name: Setup Java + uses: actions/setup-java@v1 + with: + java-version: '12.x' - name: Setup Flutter + uses: subosito/flutter-action@v1 + with: + channel: beta - name: Flutter version + run: flutter --version + + - name: Cache pub dependencies + uses: actions/cache@v2 + with: + path: ${{ env.FLUTTER_HOME }}/.pub-cache + key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }} + restore-keys: ${{ runner.os }}-pub- + + - name: Download pub dependencies + run: flutter pub get + + - name: Run build_runner + run: flutter pub run build_runner build --delete-conflicting-outputs + + - name: Download Android keystore + id: android_keystore + uses: timheuer/base64-to-file@v1.0.3 + 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_KEYSTORE_PASSWORD }}" >> android/key.properties + echo "keyPassword=${{ secrets.ANDROID_KEY_PASSWORD }}" >> android/key.properties + echo "keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}" >> android/key.properties + + - name: Build Android App Bundle + run: flutter build appbundle +