-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathaction.yml
More file actions
52 lines (42 loc) · 1.78 KB
/
action.yml
File metadata and controls
52 lines (42 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Build XCFramework
description: Build XCFramework for iOS and iOS Simulator
inputs:
project_name:
description: Name of the Xcode project or scheme
required: true
outputs:
xcframework_path:
description: Final path to the generated XCFramework
value: ${{ steps.build.outputs.xcframework_path }}
runs:
using: "composite"
steps:
- name: Build XCFramework
id: build
shell: bash
run: |
set -euo pipefail
PROJECT_NAME="${{ inputs.project_name }}"
BUILD_DIR="./build"
echo "🛠️ Building XCFramework..."
xcodebuild archive \
-scheme "$PROJECT_NAME" \
-configuration Release \
-destination 'generic/platform=iOS Simulator' \
-archivePath "$BUILD_DIR/${PROJECT_NAME}.framework-iphonesimulator.xcarchive" \
SKIP_INSTALL=NO \
BUILD_LIBRARIES_FOR_DISTRIBUTION=YES | xcbeautify
xcodebuild archive \
-scheme "$PROJECT_NAME" \
-configuration Release \
-destination 'generic/platform=iOS' \
-archivePath "$BUILD_DIR/${PROJECT_NAME}.framework-iphoneos.xcarchive" \
SKIP_INSTALL=NO \
BUILD_LIBRARIES_FOR_DISTRIBUTION=YES | xcbeautify
XCFRAMEWORK_PATH="$BUILD_DIR/${PROJECT_NAME}.xcframework"
xcodebuild -create-xcframework \
-framework "$BUILD_DIR/${PROJECT_NAME}.framework-iphonesimulator.xcarchive/Products/Library/Frameworks/${PROJECT_NAME}.framework" \
-framework "$BUILD_DIR/${PROJECT_NAME}.framework-iphoneos.xcarchive/Products/Library/Frameworks/${PROJECT_NAME}.framework" \
-output "$XCFRAMEWORK_PATH"
echo "✅ XCFramework built successfully"
echo "xcframework_path=$XCFRAMEWORK_PATH" >> "$GITHUB_OUTPUT"