diff --git a/.ci/scripts/xcframework.sh b/.ci/scripts/xcframework.sh old mode 100644 new mode 100755 index e38edad..063e926 --- a/.ci/scripts/xcframework.sh +++ b/.ci/scripts/xcframework.sh @@ -5,14 +5,14 @@ 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' \ + -destination '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' \ + -destination 'platform=iOS Simulator' \ -archivePath ./build/Release-iphonesimulator.xcarchive \ -derivedDataPath ./build/derivedDataPath \ SKIP_INSTALL=NO @@ -25,7 +25,7 @@ xcodebuild -create-xcframework \ xcodebuild clean archive -scheme ElasticApm_macOS \ -configuration Release \ - -destination 'generic/platform=macOS' \ + -destination 'platform=macOS' \ -archivePath ./build/Release-macOS.xcarchive \ -derivedDataPath ./build/derivedDataPath \ SKIP_INSTALL=NO @@ -36,7 +36,7 @@ xcodebuild -create-xcframework \ xcodebuild clean archive -scheme ElasticApm_tvOS \ -configuration Release \ - -destination 'generic/platform=tvOS' \ + -destination 'platform=tvOS' \ -archivePath ./build/Release-tvOS.xcarchive \ -derivedDataPath ./build/derivedDataPath \ SKIP_INSTALL=NO diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index d63c125..230439b 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,15 +1,12 @@ name: build - on: workflow_dispatch: pull_request: push: branches: - "main" - permissions: contents: read - jobs: macos: runs-on: macos-latest @@ -18,7 +15,6 @@ jobs: with: xcode-version: latest-stable - uses: actions/checkout@v4 - - name: Run build run: .ci/scripts/build.sh diff --git a/.github/workflows/xcframework.yml b/.github/workflows/xcframework.yml index 1fc663c..7ee0dca 100644 --- a/.github/workflows/xcframework.yml +++ b/.github/workflows/xcframework.yml @@ -1,29 +1,68 @@ +--- name: xcframework builder - on: workflow_dispatch: pull_request: push: branches: - "main" - permissions: contents: read - jobs: - macos: - runs-on: macos-latest - steps: - - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: latest-stable - - uses: actions/checkout@v4 - - name: xcodegen - uses: xavierLowmiller/xcodegen-action@1.1.3 - with: - spec: project.yml - quiet: true - version: '2.41.0' - - name: generate xcframeworks - run : | - ./ci/scripts/xcframework.sh \ No newline at end of file + macos: + runs-on: macos-latest + steps: + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + - uses: actions/checkout@v4 + - name: xcodegen + uses: bryce-b/xcodegen-action@patch-1 + with: + spec: project.yml + quiet: false + version: '2.41.0' + - name: generate iOS xcframeworks + run: | + xcodebuild clean archive -scheme ElasticApm_iOS \ + -configuration Release \ + -destination 'platform=iOS' \ + -archivePath ./build/Release-iOS.xcarchive \ + -derivedDataPath ./build/derivedDataPath \ + SKIP_INSTALL=NO + + xcodebuild clean archive -scheme ElasticApm_iOS \ + -configuration Release \ + -destination '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 + - name: generate macOS xcframework + run: | + xcodebuild clean archive -scheme ElasticApm_macOS \ + -configuration Release \ + -destination '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 + - name: generate tvOS xcframework + run: | + xcodebuild clean archive -scheme ElasticApm_tvOS \ + -configuration Release \ + -destination '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 \ No newline at end of file diff --git a/project.yml b/project.yml index 9671b2b..8b76e84 100644 --- a/project.yml +++ b/project.yml @@ -27,6 +27,7 @@ targets: platform: [iOS, macOS, tvOS] settings: BUILD_LIBRARY_FOR_DISTRIBUTION: YES + SWIFT_VERSION: 5 sources: - Sources/apm-agent-ios dependencies: