-
Notifications
You must be signed in to change notification settings - Fork 2
146 lines (128 loc) · 6.35 KB
/
health-sdk.build.xcframeworks.yml
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: Build HealthSDK XCFrameworks
on:
push:
tags:
- 'GiniHealthSDK;[0-9]+.[0-9]+.[0-9]+;xcframeworks**'
- 'GiniHealthSDK;[0-9]+.[0-9]+.[0-9]+-beta[0-9][0-9]+;xcframeworks**'
workflow_dispatch:
workflow_call:
secrets:
BUILD_CERTIFICATE_BASE64:
required: true
P12_PASSWORD:
required: true
BUILD_PROVISION_PROFILE_BASE64:
required: true
KEYCHAIN_PASSWORD:
required: true
jobs:
prepare-frameworks:
name: Create Release
runs-on: macos-13
steps:
- uses: maxim-lobanov/[email protected]
with:
xcode-version: '14.3.1'
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Mint
uses: fabasoad/setup-mint-action@main
- name: Setup swift-create-xcframework
run: |
/usr/local/bin/brew install mint
/usr/local/bin/mint install unsignedapps/[email protected]
- name: Run swift-create-xcframework
run: |
cd HealthSDK/GiniHealthSDKPinning
/usr/local/bin/mint run swift-create-xcframework
- name: setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2.0'
bundler-cache: true
- name: Add resources to HealthSDK target for generated Xcode project
uses: maierj/[email protected]
with:
lane: 'add_resources'
options: >
{
"project_path": "../HealthSDK/GiniHealthSDKPinning/.build/swift-create-xcframework/GiniHealthSDKPinning.xcodeproj",
"resource_name": "HealthSDKResources",
"target_name": "GiniHealthSDK",
"resources_path": "../HealthSDK/GiniHealthSDK/Sources/GiniHealthSDK/Resources",
"ci": "true"
}
- name: Archiving project
run: |
xcodebuild archive -project HealthSDK/GiniHealthSDKPinning/.build/swift-create-xcframework/GiniHealthSDKPinning.xcodeproj \
-scheme GiniHealthSDKPinning \
-sdk iphonesimulator \
-xcconfig Distribution.xcconfig \
-configuration Release \
-destination="iOS" \
-archivePath "iphonesimulatorPinning.xcarchive" SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
xcodebuild clean archive -project HealthSDK/GiniHealthSDKPinning/.build/swift-create-xcframework/GiniHealthSDKPinning.xcodeproj \
-scheme GiniHealthSDKPinning -sdk iphoneos \
-xcconfig Distribution.xcconfig \
-configuration Release \
-destination generic/platform=iOS \
-archivePath "iphoneosPinning.xcarchive" SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
- name: Generate XCFrameworks
run: |
xcodebuild -create-xcframework \
-framework iphoneosPinning.xcarchive/Products/Library/Frameworks/GiniHealthAPILibrary.framework \
-framework iphonesimulatorPinning.xcarchive/Products/Library/Frameworks/GiniHealthAPILibrary.framework \
-output GiniHealthAPILibrary.xcframework &&\
\
xcodebuild -create-xcframework \
-framework iphoneosPinning.xcarchive/Products/Library/Frameworks/GiniHealthSDK.framework \
-framework iphonesimulatorPinning.xcarchive/Products/Library/Frameworks/GiniHealthSDK.framework \
-output GiniHealthSDK.xcframework &&\
\
xcodebuild -create-xcframework \
-framework iphoneosPinning.xcarchive/Products/Library/Frameworks/GiniHealthAPILibraryPinning.framework \
-framework iphonesimulatorPinning.xcarchive/Products/Library/Frameworks/GiniHealthAPILibraryPinning.framework \
-output GiniHealthAPILibraryPinning.xcframework && \
\
xcodebuild -create-xcframework \
-framework iphoneosPinning.xcarchive/Products/Library/Frameworks/GiniHealthSDKPinning.framework \
-framework iphonesimulatorPinning.xcarchive/Products/Library/Frameworks/GiniHealthSDKPinning.framework \
-output GiniHealthSDKPinning.xcframework
- name: Sign the XCFrameworks
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.GINI_DISTRIBUTION_CERTIFICATE }}
P12_PASSWORD: ${{ secrets.GINI_DISTRIBUTION_CERTIFICATE_SECRET }}
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.GINI_HEALTH_SDK_EXAMPLE_APP_ADHOC_DISTRIBUTION_PROVISION_PROFILE }}
KEYCHAIN_PASSWORD: ${{ secrets.GINI_DISTRIBUTION_CERTIFICATE_SECRET }}
run: |
# Setup distribution certificate
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
PP_PATH1=$RUNNER_TEMP/build_pp1.mobileprovision
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# import certificate and provisioning profile from secrets
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH1
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
# apply provisioning profile
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH1 ~/Library/MobileDevice/Provisioning\ Profiles
# sign xcframeworks
codesign --timestamp -v --sign "Apple Distribution: Gini GmbH (JA825X8F7Z)" GiniHealthAPILibrary.xcframework && \
codesign --timestamp -v --sign "Apple Distribution: Gini GmbH (JA825X8F7Z)" GiniHealthSDK.xcframework && \
codesign --timestamp -v --sign "Apple Distribution: Gini GmbH (JA825X8F7Z)" GiniHealthAPILibraryPinning.xcframework && \
codesign --timestamp -v --sign "Apple Distribution: Gini GmbH (JA825X8F7Z)" GiniHealthSDKPinning.xcframework
- name: archive frameworks GiniHealthAPILibrary
uses: actions/upload-artifact@v4
with:
name: GiniHealthSDKFramework
path: |
GiniHealthAPILibrary.xcframework
GiniHealthSDK.xcframework
GiniHealthSDKPinning.xcframework
GiniHealthAPILibraryPinning.xcframework