diff --git a/.github/workflows/publish-xcframework.yml b/.github/workflows/publish-xcframework.yml new file mode 100644 index 000000000..6dc807525 --- /dev/null +++ b/.github/workflows/publish-xcframework.yml @@ -0,0 +1,33 @@ +name: Attach .xcframework file to release + +on: workflow_dispatch +jobs: + publish-xcframework: + runs-on: macos-11 + timeout-minutes: 30 + steps: + - run: sudo xcode-select --switch /Applications/Xcode_12.5.app + - run: brew install ghr + - uses: actions/setup-node@v1 + with: + node-version: 14.x + - uses: actions/checkout@v2 + with: + ref: native-publish + - name: Build Capacitor.xcframework + run: carthage build --no-skip-current --use-xcframeworks + - name: Build CapacitorCordova.xcframework + run: | + cd ios/CapacitorCordova + xcodebuild archive -scheme Cordova -sdk iphonesimulator SKIP_INSTALL=NO -archivePath Build/iOS-Simulator + xcodebuild archive -scheme Cordova -sdk iphoneos SKIP_INSTALL=NO -archivePath Build/iOS + xcodebuild -create-xcframework -framework Build/iOS.xcarchive/Products/Library/Frameworks/Cordova.framework -framework Build/iOS-Simulator.xcarchive/Products/Library/Frameworks/Cordova.framework -output CapacitorCordova.xcframework + cd ../.. + - name: Create Capacitor.xcframework.zip + run: | + mkdir Carthage/Build/CapacitorCordova.xcframework + mv ios/CapacitorCordova/CapacitorCordova.xcframework/* Carthage/Build/CapacitorCordova.xcframework + zip -r Capacitor.xcframework.zip Carthage/Build + rm -rf ios/CapacitorCordova/CapacitorCordova.xcframework + - name: Attach ZIP to latest release + run: ghr -replace $(git describe -tags --abbrev=0) Capacitor.xcframework.zip diff --git a/.gitignore b/.gitignore index 4eeae94e4..8af65f80c 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,7 @@ android-template/app/app.iml .settings/ .project .env + +# Carthage and Carthage-built binaries +Carthage +*.xcframework.zip diff --git a/ios/Capacitor/Capacitor.xcodeproj/project.pbxproj b/ios/Capacitor/Capacitor.xcodeproj/project.pbxproj index 65f2bdc60..a0d4ea61d 100644 --- a/ios/Capacitor/Capacitor.xcodeproj/project.pbxproj +++ b/ios/Capacitor/Capacitor.xcodeproj/project.pbxproj @@ -686,6 +686,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; @@ -749,6 +750,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";