From 24e8abfd2242f3ce3b86c2f81813e7fe98ceaa52 Mon Sep 17 00:00:00 2001 From: xiaohei Date: Wed, 22 Apr 2026 22:06:35 +0800 Subject: [PATCH] ci: rewrite apple-build without GitHub actions - Use plain shell steps instead of actions/checkout, actions/flutter-action etc - Bypass go-git checkout bug in act_runner host mode - Clone repo and Flutter via git directly --- .github/workflows/apple-build.yml | 59 ++++++++++++++++++------------- 1 file changed, 34 insertions(+), 25 deletions(-) diff --git a/.github/workflows/apple-build.yml b/.github/workflows/apple-build.yml index e221359..3541014 100644 --- a/.github/workflows/apple-build.yml +++ b/.github/workflows/apple-build.yml @@ -1,20 +1,25 @@ name: Build Apple (macOS + iOS) + on: push: branches: [main] + 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: Checkout + run: | + git clone --depth 1 --branch main http://192.168.120.110:4000/AI_Team/habo.git . + - name: Install Flutter + run: | + if [ ! -d "$HOME/flutter" ]; then + git clone --depth 1 -b 3.35.7 https://github.com/flutter/flutter.git "$HOME/flutter" + fi + echo "$HOME/flutter/bin" >> $GITHUB_PATH + - name: Install deps + run: | + brew install cocoapods jq || true - name: Get dependencies run: flutter pub get - name: Build macOS @@ -24,20 +29,29 @@ jobs: 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 + run: | + # Simple artifact upload via Gitea API + cd build/macos/Build/Products/Release + curl -s -X POST \ + -H "Authorization: token ${{ github.token }}" \ + -F "file=@habo.dmg" \ + "http://192.168.120.110:4000/api/v1/repos/AI_Team/habo/actions/artifacts" || true + 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: Checkout + run: | + git clone --depth 1 --branch main http://192.168.120.110:4000/AI_Team/habo.git . + - name: Install Flutter + run: | + if [ ! -d "$HOME/flutter" ]; then + git clone --depth 1 -b 3.35.7 https://github.com/flutter/flutter.git "$HOME/flutter" + fi + echo "$HOME/flutter/bin" >> $GITHUB_PATH + - name: Install deps + run: | + brew install cocoapods jq || true - name: Get dependencies run: flutter pub get - name: Install CocoaPods @@ -50,8 +64,3 @@ jobs: 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