From 42b2e6ba90bb20d98ef07e8d5e90cf6af28f45d0 Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Tue, 10 Oct 2023 01:55:28 +0200 Subject: [PATCH] CI: Try to get it to build Android Avoid running this is my own special container with all the dependencies. That was a pain to maintain, and lets try to use the GitHub's recommended way of doing it. --- .github/workflows/android.yml | 32 +++++++++++++++++++++----------- pubspec.lock | 2 +- pubspec.yaml | 2 +- 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 84e5ffc8..8400c884 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -12,7 +12,6 @@ on: jobs: Build: runs-on: ubuntu-latest - container: ghcr.io/gitjournal/flutter-android-sdk:latest steps: - name: checkout uses: actions/checkout@v3 @@ -21,17 +20,28 @@ jobs: - run: git config --global --add safe.directory '*' - name: Test run: ./scripts/test.sh - # - name: Test Report - # uses: dorny/test-reporter@v1 - # if: success() || failure() - # with: - # name: Unit Tests ${{ matrix.os }} ${{ matrix.sdk }} - # path: test-results.xml - # reporter: jest-junit - - name: Unlock Secrets + + - name: Unlock secrets + uses: sliteteam/github-action-git-crypt-unlock@1.2.0 env: - GITCRYPT_KEY: ${{ secrets.GITCRYPT_KEY }} - run: ./scripts/decrypt_secrets.sh + GIT_CRYPT_KEY: ${{ secrets.GITCRYPT_KEY }} + - uses: actions/setup-java@v2 + with: + distribution: "zulu" + java-version: "11" + - uses: nttld/setup-ndk@v1 + with: + ndk-version: r19 + - name: Get Flutter version from pubspec + run: | + set -e + FLUTTER_VERSION=$(cat pubspec.yaml | grep 'flutter:' | head -n 1 | awk '{ print $2 }' | tr -d '"' | cut -d "=" -f 2) + echo "FLUTTER_VERSION=${FLUTTER_VERSION}" >> $GITHUB_ENV + - uses: subosito/flutter-action@v2 + with: + flutter-version: ${{ env.FLUTTER_VERSION }} + cache: true + - name: Setup Env run: dart ./scripts/setup_env.dart - name: Build diff --git a/pubspec.lock b/pubspec.lock index d03f9b82..10fbed17 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -2116,4 +2116,4 @@ packages: version: "0.0.12" sdks: dart: ">=3.1.0-185.0.dev <4.0.0" - flutter: ">=3.10.0" + flutter: ">=3.13.6" diff --git a/pubspec.yaml b/pubspec.yaml index 312b38ef..8e47b254 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,7 +4,7 @@ version: 1.86.2+10 environment: sdk: ">=2.19.2 <3.0.0" - flutter: ">=3.7.2" + flutter: ">=3.13.6" publish_to: none