mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 03:06:59 +08:00
56 lines
1.6 KiB
YAML
56 lines
1.6 KiB
YAML
name: Android Release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
android:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: 代码迁出
|
|
uses: actions/checkout@v4
|
|
|
|
- name: 构建Java环境
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: "zulu"
|
|
java-version: "17"
|
|
|
|
- name: 检查缓存
|
|
uses: actions/cache@v4
|
|
id: cache-flutter
|
|
with:
|
|
path: /root/flutter-sdk # Flutter SDK 的路径
|
|
key: ${{ runner.os }}-flutter-${{ hashFiles('**/pubspec.lock') }}
|
|
|
|
- name: 安装Flutter
|
|
if: steps.cache-flutter.outputs.cache-hit != 'true'
|
|
uses: subosito/flutter-action@v2
|
|
with:
|
|
flutter-version: 3.24.0
|
|
channel: any
|
|
|
|
- name: 下载项目依赖
|
|
run: flutter pub get
|
|
|
|
- name: Write key
|
|
run: |
|
|
if [ ! -z "${{ secrets.SIGN_KEYSTORE_BASE64 }}" ]; then
|
|
echo "${{ secrets.SIGN_KEYSTORE_BASE64 }}" | base64 --decode > android/app/key.jks
|
|
echo storeFile='key.jks' >> android/key.properties
|
|
echo storePassword='${{ secrets.KEYSTORE_PASSWORD }}' >> android/key.properties
|
|
echo keyAlias='${{ secrets.KEY_ALIAS }}' >> android/key.properties
|
|
echo keyPassword='${{ secrets.KEY_PASSWORD }}' >> android/key.properties
|
|
fi
|
|
|
|
- name: flutter build apk
|
|
run: flutter build apk --release --target-platform=android-arm64
|
|
|
|
- name: 上传
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: Pilipala-Release
|
|
path: |
|
|
build/app/outputs/flutter-apk/*.apk
|