mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-25 19:46:47 +08:00
28
.github/workflows/main.yml
vendored
28
.github/workflows/main.yml
vendored
@@ -5,8 +5,7 @@ on:
|
||||
push:
|
||||
# push tag时触发
|
||||
tags:
|
||||
- "[0-9]+.[0-9]+.[0-9]+*"
|
||||
- "!*beta*"
|
||||
- "v*.*.*"
|
||||
|
||||
# 可以有多个jobs
|
||||
jobs:
|
||||
@@ -48,14 +47,6 @@ jobs:
|
||||
env:
|
||||
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
|
||||
|
||||
- name: 获取版本号
|
||||
id: version
|
||||
run: echo "version=${GITHUB_REF#refs/tags/}" >>$GITHUB_OUTPUT
|
||||
|
||||
- name: 修改pubspec.yaml
|
||||
run: |
|
||||
sed -i "s/version: .*/version: ${{ steps.version.outputs.version }}/g" pubspec.yaml
|
||||
|
||||
- name: flutter build apk
|
||||
run: flutter build apk --release --split-per-abi
|
||||
env:
|
||||
@@ -70,6 +61,9 @@ jobs:
|
||||
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
|
||||
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD}}
|
||||
|
||||
- name: 获取版本号
|
||||
id: version
|
||||
run: echo "version=${GITHUB_REF#refs/tags/v}" >>$GITHUB_OUTPUT
|
||||
|
||||
# - name: 获取当前日期
|
||||
# id: date
|
||||
@@ -77,6 +71,7 @@ jobs:
|
||||
|
||||
- name: 重命名应用
|
||||
run: |
|
||||
# DATE=${{ steps.date.outputs.date }}
|
||||
for file in build/app/outputs/flutter-apk/app-*.apk; do
|
||||
if [[ $file =~ app-(.?*)release.apk ]]; then
|
||||
new_file_name="build/app/outputs/flutter-apk/Pili-${BASH_REMATCH[1]}${{ steps.version.outputs.version }}.apk"
|
||||
@@ -105,22 +100,19 @@ jobs:
|
||||
cache: true
|
||||
flutter-version: 3.16.5
|
||||
|
||||
- name: 获取版本号
|
||||
id: version
|
||||
run: echo "version=${GITHUB_REF#refs/tags/}" >>$GITHUB_OUTPUT
|
||||
|
||||
- name: 修改pubspec.yaml
|
||||
run: |
|
||||
sed -i "s/version: .*/version: ${{ steps.version.outputs.version }}/g" pubspec.yaml
|
||||
|
||||
- name: flutter build ipa
|
||||
run: |
|
||||
flutter build ios --release --no-codesign
|
||||
ln -sf ./build/ios/iphoneos Payload
|
||||
zip -r9 app.ipa Payload/runner.app
|
||||
|
||||
- name: 获取版本号
|
||||
id: version
|
||||
run: echo "version=${GITHUB_REF#refs/tags/v}" >>$GITHUB_OUTPUT
|
||||
|
||||
- name: 重命名应用
|
||||
run: |
|
||||
DATE=${{ steps.date.outputs.date }}
|
||||
for file in app.ipa; do
|
||||
new_file_name="build/Pili-${{ steps.version.outputs.version }}.ipa"
|
||||
mv "$file" "$new_file_name"
|
||||
|
||||
Reference in New Issue
Block a user