diff --git a/.ci/scripts/xcframework.sh b/.ci/scripts/xcframework.sh new file mode 100644 index 0000000..e38edad --- /dev/null +++ b/.ci/scripts/xcframework.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash +# Bash strict mode +set -eo pipefail +trap 's=$?; echo >&2 "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR + +xcodebuild clean archive -scheme ElasticApm_iOS \ + -configuration Release \ + -destination 'generic/platform=iOS' \ + -archivePath ./build/Release-iOS.xcarchive \ + -derivedDataPath ./build/derivedDataPath \ + SKIP_INSTALL=NO + +xcodebuild clean archive -scheme ElasticApm_iOS \ + -configuration Release \ + -destination 'generic/platform=iOS Simulator' \ + -archivePath ./build/Release-iphonesimulator.xcarchive \ + -derivedDataPath ./build/derivedDataPath \ + SKIP_INSTALL=NO + +xcodebuild -create-xcframework \ + -framework $(pwd)/build/Release-iOS.xcarchive/Products/Library/Frameworks/ElasticApm.framework \ + -framework $(pwd)/build/Release-iphonesimulator.xcarchive/Products/Library/Frameworks/ElasticApm.framework \ + -output ./build/ElasticApm_iOS.xcframework + + +xcodebuild clean archive -scheme ElasticApm_macOS \ + -configuration Release \ + -destination 'generic/platform=macOS' \ + -archivePath ./build/Release-macOS.xcarchive \ + -derivedDataPath ./build/derivedDataPath \ + SKIP_INSTALL=NO + +xcodebuild -create-xcframework \ + -framework $(pwd)/build/Release-macOS.xcarchive/Products/Library/Frameworks/ElasticApm.framework \ + -output ./build/ElasticApm_macOS.xcframework + +xcodebuild clean archive -scheme ElasticApm_tvOS \ + -configuration Release \ + -destination 'generic/platform=tvOS' \ + -archivePath ./build/Release-tvOS.xcarchive \ + -derivedDataPath ./build/derivedDataPath \ + SKIP_INSTALL=NO + +xcodebuild -create-xcframework \ + -framework $(pwd)/build/Release-tvOS.xcarchive/Products/Library/Frameworks/ElasticApm.framework \ + -output ./build/ElasticApm_tvOS.xcframework + + diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index a2c6640..8561b99 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -26,6 +26,16 @@ jobs: run: | xcodebuild -scheme apm-agent-ios -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 15' test + - name: Build XCFramework + uses: xavierLowmiller/xcodegen-action@1.1.3 + with: + spec: project.yaml + quiet: true + version: '2.41.0' + run : | + xcodegen --generate + ./ci/scripts/xcframework.sh + - name: Run package snapshots run: .ci/scripts/package.sh diff --git a/xcframework-builder.sh b/xcframework-builder.sh deleted file mode 100755 index 442afdf..0000000 --- a/xcframework-builder.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash - -xcodebuild clean archive -scheme ElasticApm_iOS \ - -configuration Release \ - -destination 'generic/platform=iOS' \ - -archivePath Release-iOS.xcarchive \ - -derivedDataPath derivedDataPath \ - SKIP_INSTALL=NO - -xcodebuild clean archive -scheme ElasticApm_iOS \ - -configuration Release \ - -destination 'generic/platform=iOS Simulator' \ - -archivePath Release-iphonesimulator.xcarchive \ - -derivedDataPath derivedDataPath \ - SKIP_INSTALL=NO - -xcodebuild clean archive -scheme ElasticApm_macOS \ - -configuration Release \ - -destination 'generic/platform=macOS' \ - -archivePath Release-macOS.xcarchive \ - -derivedDataPath derivedDataPath \ - SKIP_INSTALL=NO - - -xcodebuild clean archive -scheme ElasticApm_tvOS \ - -configuration Release \ - -destination 'generic/platform=tvOS' \ - -archivePath Release-tvOS.xcarchive \ - -derivedDataPath derivedDataPath \ - SKIP_INSTALL=NO - -xcodebuild -create-xcframework \ - -framework $(pwd)/Release-iOS.xcarchive/Products/Library/Frameworks/ElasticApm.framework \ - -framework $(pwd)/Release-iphonesimulator.xcarchive/Products/Library/Frameworks/ElasticApm.framework \ - -framework $(pwd)/Release-macOS.xcarchive/Products/Library/Frameworks/ElasticApm.framework \ - -framework $(pwd)/Release-tvOS.xcarchive/Products/Library/Frameworks/ElasticApm.framework \ - -output ElasticApm.xcframework - -