diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7423626c..d0f76b7b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -242,67 +242,11 @@ jobs: key: pods-${{ runner.os }}-${{ hashFiles('ios/Podfile.lock') }} restore-keys: pods-${{ runner.os }}- - - name: Install gomobile - working-directory: go_backend - run: | - # go.mod-pinned x/mobile version (reproducible + cached by setup-go). - go install golang.org/x/mobile/cmd/gomobile - gomobile init - - name: Build Go backend for iOS - working-directory: go_backend - run: | - mkdir -p ../ios/Frameworks - gomobile bind -target=ios -tags ios -o ../ios/Frameworks/Gobackend.xcframework . + run: bash scripts/build_ios.sh env: CGO_ENABLED: 1 - - name: Verify XCFramework created - run: | - ls -la ios/Frameworks/ - ls -la ios/Frameworks/Gobackend.xcframework/ || (echo "ERROR: XCFramework not found!" && exit 1) - - - name: Add XCFramework to Xcode project - run: | - # xcodeproj usually ships with the preinstalled CocoaPods; only - # install it when missing. - gem list -i xcodeproj >/dev/null || sudo gem install xcodeproj - - # Create Ruby script to add framework - cat > add_framework.rb << 'EOF' - require 'xcodeproj' - - project_path = 'ios/Runner.xcodeproj' - project = Xcodeproj::Project.open(project_path) - - # Get the main target - target = project.targets.find { |t| t.name == 'Runner' } - - # Get or create Frameworks group - frameworks_group = project.main_group.find_subpath('Frameworks', true) - frameworks_group ||= project.main_group.new_group('Frameworks') - - # Add XCFramework reference - framework_path = 'Frameworks/Gobackend.xcframework' - framework_ref = frameworks_group.new_file(framework_path, :project) - - # Add to frameworks build phase - frameworks_build_phase = target.frameworks_build_phase - frameworks_build_phase.add_file_reference(framework_ref) - - # Add to embed frameworks build phase - embed_phase = target.build_phases.find { |p| p.is_a?(Xcodeproj::Project::Object::PBXCopyFilesBuildPhase) && p.name == 'Embed Frameworks' } - if embed_phase - build_file = embed_phase.add_file_reference(framework_ref) - build_file.settings = { 'ATTRIBUTES' => ['CodeSignOnCopy', 'RemoveHeadersOnCopy'] } - end - - project.save - puts "Successfully added Gobackend.xcframework to Xcode project" - EOF - - ruby add_framework.rb - - name: Setup Flutter uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2 with: