From 3ae3955f53a1ab4c92f8e55e57112d2f8aa8dd19 Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Sat, 18 Oct 2025 12:09:15 +0800 Subject: [PATCH] rename release files Signed-off-by: bggRGjQaUbCoE --- .github/workflows/android.yml | 34 ++++++++------ .github/workflows/build.yml | 75 +++++++++++++++++++++++++++++++ .github/workflows/ios.yml | 18 ++------ .github/workflows/linux_arm64.yml | 22 +++------ .github/workflows/linux_x64.yml | 22 +++------ .github/workflows/mac.yml | 16 +------ .github/workflows/win_x64.yml | 20 ++------- 7 files changed, 115 insertions(+), 92 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index a6657dd0..bc098bd4 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -1,18 +1,18 @@ -name: Android Release +name: Build for Android on: - pull_request: - types: - - opened - - synchronize - - reopened - - ready_for_review - paths-ignore: - - "**.md" + workflow_call: + inputs: + sign: + description: "sign" + required: false + default: true + type: boolean workflow_dispatch: jobs: android: + name: Release Android runs-on: ubuntu-latest steps: @@ -48,7 +48,7 @@ jobs: # run: flutter pub get - name: Write key - if: github.event_name != 'pull_request' + if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'workflow_call' && inputs.sign == 'true') }} run: | if [ ! -z "${{ secrets.SIGN_KEYSTORE_BASE64 }}" ]; then echo "${{ secrets.SIGN_KEYSTORE_BASE64 }}" | base64 --decode > android/app/key.jks @@ -65,23 +65,31 @@ jobs: - name: flutter build apk run: flutter build apk --release --split-per-abi --dart-define-from-file=pili_release.json --pub + - name: rename + run: | + for file in build/app/outputs/flutter-apk/app-*-release.apk; do + abi=$(echo "$file" | sed -E 's|.*app-(.*)-release\.apk|\1|') + mv "$file" "PiliPlus_android_${{ env.version }}_${abi}.apk" + done + shell: bash + - name: 上传 uses: actions/upload-artifact@v4 with: name: app-arm64-v8a path: | - build/app/outputs/flutter-apk/app-arm64-v8a-release.apk + PiliPlus_android_*_arm64-v8a.apk - name: 上传 uses: actions/upload-artifact@v4 with: name: app-armeabi-v7a path: | - build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk + PiliPlus_android_*_armeabi-v7a.apk - name: 上传 uses: actions/upload-artifact@v4 with: name: app-x86_64 path: | - build/app/outputs/flutter-apk/app-x86_64-release.apk + PiliPlus_android_*_x86_64.apk diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..216acd9a --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,75 @@ +name: Build + +on: + pull_request: + types: + - opened + - synchronize + - reopened + - ready_for_review + paths-ignore: + - "**.md" + workflow_dispatch: + inputs: + build_android: + description: "Build Android" + required: false + default: true + type: boolean + + build_ios: + description: "Build iOS" + required: false + default: true + type: boolean + + build_mac: + description: "Build Mac" + required: false + default: true + type: boolean + + build_win_x64: + description: "Build Win-x64" + required: false + default: true + type: boolean + + build_linux_x64: + description: "Build Linux-x64" + required: false + default: true + type: boolean + + build_linux_arm64: + description: "Build Linux-arm64" + required: false + default: true + type: boolean + +jobs: + android: + if: ${{ github.event_name == 'pull_request' || github.event.inputs.build_android == 'true' }} + uses: ./.github/workflows/android.yml + with: + sign: ${{ github.event_name != 'pull_request' }} + + ios: + if: ${{ github.event_name == 'pull_request' || github.event.inputs.build_ios == 'true' }} + uses: ./.github/workflows/ios.yml + + mac: + if: ${{ github.event_name == 'pull_request' || github.event.inputs.build_mac == 'true' }} + uses: ./.github/workflows/mac.yml + + win_x64: + if: ${{ github.event_name == 'pull_request' || github.event.inputs.build_win_x64 == 'true' }} + uses: ./.github/workflows/win_x64.yml + + linux_x64: + if: ${{ github.event_name == 'pull_request' || github.event.inputs.build_linux_x64 == 'true' }} + uses: ./.github/workflows/linux_x64.yml + + linux_arm64: + if: ${{ github.event_name == 'pull_request' || github.event.inputs.build_linux_arm64 == 'true' }} + uses: ./.github/workflows/linux_arm64.yml diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index e61e9f34..5672be01 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -1,19 +1,8 @@ name: Build for iOS on: - pull_request: - types: - - opened - - synchronize - - reopened - - ready_for_review - paths-ignore: - - "**.md" + workflow_call: workflow_dispatch: - inputs: - branch: - required: false - default: "main" jobs: build-macos-app: @@ -23,7 +12,6 @@ jobs: - name: Checkout code uses: actions/checkout@v5 with: - ref: ${{ github.event.inputs.branch }} fetch-depth: 0 - name: Setup flutter @@ -40,10 +28,10 @@ jobs: run: | flutter build ios --release --no-codesign --dart-define-from-file=pili_release.json ln -sf ./build/ios/iphoneos Payload - zip -r9 ios-release-no-sign.ipa Payload/runner.app + zip -r9 PiliPlus_ios_${{env.version}}.ipa Payload/runner.app - name: Upload ios release uses: actions/upload-artifact@v4 with: name: ios-release - path: ios-release-no-sign.ipa + path: PiliPlus_ios_*.ipa diff --git a/.github/workflows/linux_arm64.yml b/.github/workflows/linux_arm64.yml index a2a90d05..c8cebd76 100644 --- a/.github/workflows/linux_arm64.yml +++ b/.github/workflows/linux_arm64.yml @@ -1,29 +1,17 @@ name: Build for Linux Arm64 on: - pull_request: - types: - - opened - - synchronize - - reopened - - ready_for_review - paths-ignore: - - "**.md" + workflow_call: workflow_dispatch: - inputs: - branch: - required: false - default: "main" jobs: build-linux-app: - name: Release Linux + name: Release Linux Arm64 runs-on: ubuntu-24.04-arm steps: - name: Checkout repository uses: actions/checkout@v5 with: - ref: ${{ github.event.inputs.branch }} fetch-depth: 0 - name: Install dependencies @@ -106,13 +94,13 @@ jobs: dpkg-deb --build --verbose --root-owner-group "PiliPlus_linux_${{ env.version }}_arm64" printf "完成: PiliPlus_linux_%s_arm64.deb\n" "${{ env.version }}" shell: bash - + - name: Packege rpm run: | printf "建立 RPM 构建目录...\n" RPM_BUILD_ROOT="$PWD/rpm_build" mkdir -p "$RPM_BUILD_ROOT/BUILD" "$RPM_BUILD_ROOT/RPMS" "$RPM_BUILD_ROOT/SOURCES" "$RPM_BUILD_ROOT/SPECS" "$RPM_BUILD_ROOT/SRPMS" - + printf "准备源码归档(仅包含运行时与元数据)...\n" DATE="$(date '+%a %b %d %Y')" SRC_DIR="$PWD/piliplus-${{ env.version }}" @@ -197,7 +185,7 @@ jobs: with: name: Linux_deb_arm64_package path: PiliPlus_linux_*.deb - + - name: Upload linux rpm package uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/linux_x64.yml b/.github/workflows/linux_x64.yml index 07ec6c6d..a73634fc 100644 --- a/.github/workflows/linux_x64.yml +++ b/.github/workflows/linux_x64.yml @@ -1,29 +1,17 @@ name: Build for Linux x64 on: - pull_request: - types: - - opened - - synchronize - - reopened - - ready_for_review - paths-ignore: - - "**.md" + workflow_call: workflow_dispatch: - inputs: - branch: - required: false - default: "main" jobs: build-linux-app: - name: Release Linux + name: Release Linux x64 runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v5 with: - ref: ${{ github.event.inputs.branch }} fetch-depth: 0 - name: Install dependencies @@ -106,13 +94,13 @@ jobs: dpkg-deb --build --verbose --root-owner-group "PiliPlus_linux_${{ env.version }}_amd64" printf "完成: PiliPlus_linux_%s_amd64.deb\n" "${{ env.version }}" shell: bash - + - name: Packege rpm run: | printf "建立 RPM 构建目录...\n" RPM_BUILD_ROOT="$PWD/rpm_build" mkdir -p "$RPM_BUILD_ROOT/BUILD" "$RPM_BUILD_ROOT/RPMS" "$RPM_BUILD_ROOT/SOURCES" "$RPM_BUILD_ROOT/SPECS" "$RPM_BUILD_ROOT/SRPMS" - + printf "准备源码归档(仅包含运行时与元数据)...\n" DATE="$(date '+%a %b %d %Y')" SRC_DIR="$PWD/piliplus-${{ env.version }}" @@ -197,7 +185,7 @@ jobs: with: name: Linux_deb_amd64_package path: PiliPlus_linux_*.deb - + - name: Upload linux rpm package uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 5741ca42..6e334177 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -1,19 +1,8 @@ name: Build for Mac on: - pull_request: - types: - - opened - - synchronize - - reopened - - ready_for_review - paths-ignore: - - "**.md" + workflow_call: workflow_dispatch: - inputs: - branch: - required: false - default: "main" jobs: build-mac-app: @@ -23,7 +12,6 @@ jobs: - name: Checkout code uses: actions/checkout@v5 with: - ref: ${{ github.event.inputs.branch }} fetch-depth: 0 - name: Setup flutter @@ -52,4 +40,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: macos-release - path: PiliPlus*.dmg + path: PiliPlus_macos_*.dmg diff --git a/.github/workflows/win_x64.yml b/.github/workflows/win_x64.yml index c0ca2848..5207f167 100644 --- a/.github/workflows/win_x64.yml +++ b/.github/workflows/win_x64.yml @@ -1,29 +1,17 @@ name: Build for Windows x64 on: - pull_request: - types: - - opened - - synchronize - - reopened - - ready_for_review - paths-ignore: - - "**.md" + workflow_call: workflow_dispatch: - inputs: - branch: - required: false - default: "main" jobs: build-windows-app: - name: Release Windows + name: Release Windows x64 runs-on: windows-latest steps: - name: Checkout code uses: actions/checkout@v5 with: - ref: ${{ github.event.inputs.branch }} fetch-depth: 0 - name: Setup flutter @@ -55,12 +43,12 @@ jobs: mkdir -p Release/PiliPlus-Win mkdir -p PiliPlus-Win-Setup mv build/windows/x64/runner/Release/* Release/PiliPlus-Win/ - mv dist/**/*.exe PiliPlus-Win-Setup/PiliPlus-${{env.version}}-Windows-x64-Setup.exe + mv dist/**/*.exe PiliPlus-Win-Setup/PiliPlus_windows_${{env.version}}_x64_setup.exe - name: Upload windows file release uses: actions/upload-artifact@v4 with: - name: windows-x64-release + name: PiliPlus_windows_${{env.version}}_x64 path: Release - name: Upload windows setup release