From d3e09bd92bd36c92026d5ec74129b1c3c1253014 Mon Sep 17 00:00:00 2001 From: xiaohei Date: Wed, 22 Apr 2026 14:25:31 +0800 Subject: [PATCH] ci: add apple-only workflow, disable push trigger on others --- .github/workflows/apple-only.yml | 65 ++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 5 ++- .github/workflows/ios-only.yml | 3 +- 3 files changed, 69 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/apple-only.yml diff --git a/.github/workflows/apple-only.yml b/.github/workflows/apple-only.yml new file mode 100644 index 0000000..4991131 --- /dev/null +++ b/.github/workflows/apple-only.yml @@ -0,0 +1,65 @@ +name: Build Apple (macOS + iOS) + +on: + push: + branches: [main] + paths: + - '**' + - '!.github/workflows/ci.yml' + workflow_dispatch: + +jobs: + build-macos: + runs-on: mac-runner + steps: + - uses: actions/checkout@v4 + - name: Install jq + run: brew install jq + - name: Setup Flutter + uses: actions/flutter-action@v2 + with: + flutter-version: '3.35.7' + - name: Install macOS deps + run: | + brew install cocoapods + - name: Get dependencies + run: flutter pub get + - name: Build macOS + run: flutter build macos --release + - name: Create DMG + run: | + cd build/macos/Build/Products/Release + hdiutil create -volname Habo -srcfolder habo.app -ov -format UDZO habo.dmg + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: habo-macos + path: build/macos/Build/Products/Release/habo.dmg + + build-ios: + runs-on: mac-runner + steps: + - uses: actions/checkout@v4 + - name: Install jq + run: brew install jq + - name: Setup Flutter + uses: actions/flutter-action@v2 + with: + flutter-version: '3.35.7' + - name: Get dependencies + run: flutter pub get + - name: Install CocoaPods + run: cd ios && pod install + - name: Build iOS + run: flutter build ios --release --no-codesign --no-tree-shake-icons + - name: Package .app + run: | + mkdir -p payload + cp -r build/ios/iphoneos/Runner.app payload/ + cd payload + zip -r ../Habo-iOS-no-sign.zip Runner.app + - name: Upload iOS artifact + uses: actions/upload-artifact@v4 + with: + name: habo-ios-no-sign + path: Habo-iOS-no-sign.zip diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d3bdc90..c67ef4d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,8 @@ name: Build & Test - on: - push: + pull_request: + branches: [main] + workflow_dispatch: branches: [main] pull_request: branches: [main] diff --git a/.github/workflows/ios-only.yml b/.github/workflows/ios-only.yml index f067464..ec9a986 100644 --- a/.github/workflows/ios-only.yml +++ b/.github/workflows/ios-only.yml @@ -1,7 +1,6 @@ name: Build iOS - on: - push: + workflow_dispatch: branches: [main] workflow_dispatch: