name: Build iOS
on:
  workflow_dispatch:
    branches: [main]
  workflow_dispatch:

jobs:
  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
