Skip to content

Commit

Permalink
chore(ci): Add GitHub action for xcframework (#5415)
Browse files Browse the repository at this point in the history
* feat(ci): Add GitHub action for xcframework
* fix(ci): Remove duplicate CI commands from publish-ios workflow
* feat(ci): create GitHub action that builds, zips, and attachs xcframework to latest release
* fix(ci): Add 'BUILD_LIBRARY_FOR_DISTRIBUTION' flag
  • Loading branch information
thomasvidas authored Feb 9, 2022
1 parent 9420f08 commit f9051d0
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/publish-xcframework.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ android-template/app/app.iml
.settings/
.project
.env

# Carthage and Carthage-built binaries
Carthage
*.xcframework.zip
2 changes: 2 additions & 0 deletions ios/Capacitor/Capacitor.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down

0 comments on commit f9051d0

Please sign in to comment.