From 9f92d79b181dc57ef6b333ea50c423af3308a1d0 Mon Sep 17 00:00:00 2001 From: lifegpc Date: Fri, 8 Sep 2023 11:47:15 +0800 Subject: [PATCH] Update android_ci.yml --- .github/workflows/android_ci.yml | 72 +++++++++++++------------------- 1 file changed, 29 insertions(+), 43 deletions(-) diff --git a/.github/workflows/android_ci.yml b/.github/workflows/android_ci.yml index 814e782..249abd2 100644 --- a/.github/workflows/android_ci.yml +++ b/.github/workflows/android_ci.yml @@ -1,48 +1,34 @@ -name: Android CI - +name: Android Build on: push: - pull_request: - + branches: ["*"] jobs: - build: - + android: runs-on: ubuntu-latest - steps: - - name: Get current time - uses: 1466587594/get-current-time@v2 - id: current-time - with: - format: YYYYMMDD-HH - utcOffset: "+08:00" - - - uses: actions/checkout@v3 - - uses: dart-lang/setup-dart@9a04e6d73cca37bd455e0608d7e5092f881fd603 - - name: set up JDK 11 - uses: actions/setup-java@v3 - with: - java-version: '11' - distribution: 'adopt' - cache: gradle - - - name: Install dependencies - run: flutter pub get - - - name: Decode Keystore - env: - ENCODED_STRING: ${{ secrets.SIGNING_STORE_BASE64 }} - run: echo $ENCODED_STRING | base64 -di > app/keystore.jks - - - name: Build apk - run: flutter build apk --release --split-per-abi - env: - CI: true - SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }} - SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }} - SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }} - - name: Upload artifact - uses: actions/upload-artifact@v2.2.0 - with: - name: app-release.${{ steps.current-time.outputs.formattedTime }} - path: android/app/release/*.apk + - uses: actions/checkout@v4 + - name: Setup flutter + uses: subosito/flutter-action@v2 + with: + channel: stable + - name: set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'adopt' + cache: gradle + - name: Decode Keystore + env: + ENCODED_STRING: ${{ secrets.SIGNING_STORE_BASE64 }} + run: echo $ENCODED_STRING | base64 -di > app/keystore.jks + - name: Build apk + run: flutter build apk --release --split-per-abi + env: + CI: true + SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }} + SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }} + SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }} + - name: Upload artifact + with: + name: app-release + path: android/app/release/*.apk