diff --git a/.github/workflows/xcframework.yml b/.github/workflows/xcframework.yml index 7b90fd5..0e6399c 100644 --- a/.github/workflows/xcframework.yml +++ b/.github/workflows/xcframework.yml @@ -11,7 +11,7 @@ permissions: contents: read id-token: write jobs: - iOS: + iOS-device: runs-on: macos-latest steps: - uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0 @@ -24,7 +24,7 @@ jobs: spec: project.yml quiet: false version: '2.41.0' - - name: generate iOS xcframeworks + - name: Build iOS device run: | xcodebuild clean archive -scheme ElasticApm_iOS \ -configuration Release \ @@ -32,12 +32,43 @@ jobs: -archivePath ./build/Release-iOS.xcarchive \ -derivedDataPath ./build/derivedDataPath \ SKIP_INSTALL=NO + iOS-simulator: + runs-on: macos-latest + steps: + - uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0 + 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: Build iOS simulator + run: | xcodebuild clean archive -scheme ElasticApm_iOS \ -configuration Release \ -destination 'generic/platform=iOS Simulator' \ -archivePath ./build/Release-iphonesimulator.xcarchive \ -derivedDataPath ./build/derivedDataPath \ SKIP_INSTALL=NO + iOS-xcframework: + runs-on: macos-latest + needs: [iOS-simulator, iOS-device] + steps: + - uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0 + 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: Build iOS xcframework + run: | xcodebuild -create-xcframework \ -framework ${{ github.workspace }}/build/Release-iOS.xcarchive/Products/Library/Frameworks/ElasticApm.framework \ -framework ${{ github.workspace }}/build/Release-iphonesimulator.xcarchive/Products/Library/Frameworks/ElasticApm.framework \ @@ -55,7 +86,7 @@ jobs: spec: project.yml quiet: false version: '2.41.0' - - name: generate macOS xcframework + - name: Build macOS xcframework run: | xcodebuild clean archive -scheme ElasticApm_macOS \ -configuration Release \ @@ -79,7 +110,7 @@ jobs: spec: project.yml quiet: false version: '2.41.0' - - name: generate tvOS xcframework + - name: Build tvOS xcframework run: | xcodebuild clean archive -scheme ElasticApm_tvOS \ -configuration Release \ @@ -92,7 +123,7 @@ jobs: -output ./package/ElasticApm_tvOS.xcframework package: runs-on: macos-latest - needs: [iOS, macOS, tvOS] + needs: [iOS-xcframework, macOS, tvOS] steps: - uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0 with: @@ -108,7 +139,7 @@ jobs: tar -czf "./dist/ElasticApm_tvOS-${APP_VERSION}.tar.gz" -C ./package ElasticApm_tvOS.xcframework tar -czf "./dist/ElasticApm_macOS-${APP_VERSION}.tar.gz" -C ./package ElasticApm_macOS.xcframework tar -czf "./dist/ElasticApm_iOS-${APP_VERSION}.tar.gz" -C ./package ElasticApm_iOS.xcframework - - name: Generate Framework provenance + - name: Generate framework provenance uses: actions/attest-build-provenance@173725a1209d09b31f9d30a3890cf2757ebbff0d # v1.1.2 with: subject-path: "./dist/*"