iOS unsigned build (.app + pseudo .ipa) #10
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: iOS unsigned build (.app + pseudo .ipa) | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: ["main"] | |
| jobs: | |
| build-ios-unsigned: | |
| runs-on: macos-14 | |
| defaults: | |
| run: | |
| working-directory: example_app/fluttida | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| channel: "stable" | |
| cache: true | |
| - name: Flutter doctor | |
| run: flutter doctor -v | |
| - name: Pub get | |
| run: flutter pub get | |
| - name: Install CocoaPods | |
| run: | | |
| cd ios | |
| pod install --repo-update | |
| # --- Patch Xcode project so LegacyCFURLConnection.m is compiled in Runner target --- | |
| - name: Patch Runner.xcodeproj (add LegacyCFURLConnection) | |
| run: | | |
| sudo gem install xcodeproj | |
| ruby - <<'RUBY' | |
| require 'xcodeproj' | |
| proj_path = 'ios/Runner.xcodeproj' | |
| proj = Xcodeproj::Project.open(proj_path) | |
| target = proj.targets.find { |t| t.name == 'Runner' } | |
| raise "Runner target not found" unless target | |
| runner_group = proj.main_group.find_subpath('Runner', true) | |
| h_path = 'LegacyCFURLConnection.h' | |
| m_path = 'LegacyCFURLConnection.m' | |
| proj.files.find { |f| f.path == h_path } || runner_group.new_file(h_path) | |
| m_ref = proj.files.find { |f| f.path == m_path } || runner_group.new_file(m_path) | |
| already = target.source_build_phase.files_references.any? { |fr| fr.path == m_path } | |
| unless already | |
| target.add_file_references([m_ref]) | |
| puts "Added #{m_path} to Runner target" | |
| else | |
| puts "#{m_path} already in Runner target" | |
| end | |
| proj.save | |
| RUBY | |
| - name: Verify pbxproj contains LegacyCFURLConnection | |
| run: | | |
| grep -n "LegacyCFURLConnection" ios/Runner.xcodeproj/project.pbxproj | |
| - name: Build iOS (release, no codesign) | |
| run: flutter build ios --release --no-codesign --verbose | |
| - name: Create unsigned IPA from .app (Payload zip) | |
| run: | | |
| APP_DIR="build/ios/iphoneos/Runner.app" | |
| if [ ! -d "$APP_DIR" ]; then | |
| echo "Runner.app not found at $APP_DIR" | |
| ls -la build/ios/iphoneos || true | |
| exit 1 | |
| fi | |
| mkdir -p build/ios/ipa/Payload | |
| rm -rf build/ios/ipa/Payload/* | |
| cp -R "$APP_DIR" build/ios/ipa/Payload/Runner.app | |
| cd build/ios/ipa | |
| zip -r Fluttida-unsigned.ipa Payload | |
| cd - | |
| ls -la build/ios/ipa | |
| - name: Upload Runner.app | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Fluttida-Runner-app | |
| path: example_app/fluttida/build/ios/iphoneos/Runner.app | |
| - name: Upload unsigned IPA | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Fluttida-unsigned-ipa | |
| path: example_app/fluttida/build/ios/ipa/Fluttida-unsigned.ipa |