update ci
This commit is contained in:
57
.github/workflows/build-android.yml
vendored
Normal file
57
.github/workflows/build-android.yml
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
# 由于安卓构建需要较长时间,故创建备用的独立工作流
|
||||
name: Build Android App
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*' # 监听所有标签的推送
|
||||
workflow_dispatch:
|
||||
# 允许手动触发工作流
|
||||
|
||||
jobs:
|
||||
#-------------------------------------------------
|
||||
# Android (Unchanged, as it builds a universal app)
|
||||
#-------------------------------------------------
|
||||
build_android:
|
||||
name: Build Android
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up JDK 21
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '21'
|
||||
distribution: 'temurin'
|
||||
|
||||
- name: Setup Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: 'stable'
|
||||
|
||||
- name: Get Flutter dependencies
|
||||
run: flutter pub get
|
||||
|
||||
- name: Decode Keystore
|
||||
run: echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > android/app/upload-keystore.jks
|
||||
|
||||
- name: Create key.properties file
|
||||
run: |
|
||||
echo "storeFile=$(pwd)/android/app/upload-keystore.jks" > android/key.properties
|
||||
echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> android/key.properties
|
||||
echo "storePassword=${{ secrets.STORE_PASSWORD }}" >> android/key.properties
|
||||
echo "keyAlias=${{ secrets.KEY_ALIAS }}" >> android/key.properties
|
||||
|
||||
- name: Build Flutter App Bundle and APK
|
||||
run: |
|
||||
flutter build appbundle --release
|
||||
flutter build apk --release
|
||||
|
||||
- name: Upload Android Artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: android-builds
|
||||
path: |
|
||||
build/app/outputs/bundle/release/app-release.aab
|
||||
build/app/outputs/flutter-apk/app-release.apk
|
||||
Reference in New Issue
Block a user