Update android_ci.yml

This commit is contained in:
2023-09-08 11:47:15 +08:00
committed by GitHub
parent 2ca8663f06
commit 9f92d79b18

View File

@@ -1,48 +1,34 @@
name: Android CI name: Android Build
on: on:
push: push:
pull_request: branches: ["*"]
jobs: jobs:
build: android:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Get current time - uses: actions/checkout@v4
uses: 1466587594/get-current-time@v2 - name: Setup flutter
id: current-time uses: subosito/flutter-action@v2
with: with:
format: YYYYMMDD-HH channel: stable
utcOffset: "+08:00" - name: set up JDK 11
uses: actions/setup-java@v3
- uses: actions/checkout@v3 with:
- uses: dart-lang/setup-dart@9a04e6d73cca37bd455e0608d7e5092f881fd603 java-version: '11'
- name: set up JDK 11 distribution: 'adopt'
uses: actions/setup-java@v3 cache: gradle
with: - name: Decode Keystore
java-version: '11' env:
distribution: 'adopt' ENCODED_STRING: ${{ secrets.SIGNING_STORE_BASE64 }}
cache: gradle run: echo $ENCODED_STRING | base64 -di > app/keystore.jks
- name: Build apk
- name: Install dependencies run: flutter build apk --release --split-per-abi
run: flutter pub get env:
CI: true
- name: Decode Keystore SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
env: SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
ENCODED_STRING: ${{ secrets.SIGNING_STORE_BASE64 }} SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
run: echo $ENCODED_STRING | base64 -di > app/keystore.jks - name: Upload artifact
with:
- name: Build apk name: app-release
run: flutter build apk --release --split-per-abi path: android/app/release/*.apk
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/[email protected]
with:
name: app-release.${{ steps.current-time.outputs.formattedTime }}
path: android/app/release/*.apk