Skip to content

Xcframework generation #32

Xcframework generation

Xcframework generation #32

Workflow file for this run

---
name: xcframework builder
on:
workflow_dispatch:
pull_request:
push:
branches:
- "main"
permissions:
attestations: write
contents: read
id-token: write
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: 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 '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 ${{ github.workspace }}/build/Release-iOS.xcarchive/Products/Library/Frameworks/ElasticApm.framework \
# -framework ${{ github.workspace }}/build/Release-iphonesimulator.xcarchive/Products/Library/Frameworks/ElasticApm.framework \
# -output ${{ github.workspace }}/package/ElasticApm_iOS.xcframework
# - name: generate macOS xcframework
# run: |
# 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 ./package/ElasticApm_macOS.xcframework
- name: generate tvOS xcframework
run: |
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 ./package/ElasticApm_tvOS.xcframework
- name: Package frameworks
id: package-frameworks
run: |
av=`sed -n -E "s/public static let elasticSwiftAgentVersion: String = \"(.*)\"/\1/p" Sources/apm-agent-ios/Version.swift | sed -e 's/^[[:space:]]*//'`
echo "using version ${av}"
echo "APP_VERSION=${av}" >> "$GITHUB_ENV"
rm -rf "./dist"
mkdir -p "./dist"
echo $(pwd)
tar -czf "./dist/ElasticApm_tvOS-${av}.tar.gz" -C ./package ElasticApm_tvOS.xcframework
ls ./dist
# 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 tvOS Framework provenance
uses: actions/attest-build-provenance@173725a1209d09b31f9d30a3890cf2757ebbff0d # v1.1.2
with:
subject-path: "./dist/ElasticApm_tvOS-*.tar.gz"
# - name: Generate iOS Framework provenance
# uses: actions/attest-build-provenance@173725a1209d09b31f9d30a3890cf2757ebbff0d # v1.1.2
# env:
# APP_VERSION: ${{ steps.package-frameworks.outputs.APP_VERSION }}
# with:
# subject-path: "${{ github.workspace }}/build/ElasticApm_iOS-${APP_VERSION}.tar.gz"
# - name: Generate macOS Framework provenance
# uses: actions/attest-build-provenance@173725a1209d09b31f9d30a3890cf2757ebbff0d # v1.1.2
# env:
# APP_VERSION: ${{ steps.package-frameworks.outputs.APP_VERSION }}
# with:
# subject-path: "${{ github.workspace }}/build/ElasticApm_macOS-${APP_VERSION}.tar.gz"
- uses: actions/upload-artifact@v4
with:
name: ElasticAPM_macOS-${{ env.APP_VERSION }}.tar.gz
path: |
dist/ElasticAPM_macOS-${{ env.APP_VERSION }}.tar.gz
- uses: actions/upload-artifact@v4
with:
name: ElasticAPM_tvOS-*.tar.gz
path: |
dist/ElasticAPM_tvOS-*.tar.gz
- uses: actions/upload-artifact@v4
with:
name: ElasticAPM_iOS-.tar.gz
path: |
dist/ElasticAPM_iOS-${APP_VERSION}.tar.gz