-
Notifications
You must be signed in to change notification settings - Fork 2
185 lines (166 loc) · 8.52 KB
/
bank-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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
name: Build BankSDK XCFrameworks
on:
push:
tags:
- 'GiniBankSDK;[0-9]+.[0-9]+.[0-9]+;xcframeworks**'
- 'GiniBankSDK;[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
BUILD_PROVISION_PROFILE_EXTENSION_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: GiniBankSDKPinning Project File
run: |
cd BankSDK/GiniBankSDKPinning
/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 BankSDK target for generated Xcode project
uses: maierj/[email protected]
with:
lane: 'add_resources'
options: >
{
"project_path": "../BankSDK/GiniBankSDKPinning/.build/swift-create-xcframework/GiniBankSDKPinning.xcodeproj",
"resource_name": "BankSDKResources",
"target_name": "GiniBankSDK",
"resources_path": "../BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources",
"ci": "true"
}
- name: Add resources to CaptureSDK target for generated Xcode project
uses: maierj/[email protected]
with:
lane: 'add_resources'
options: >
{
"project_path": "../BankSDK/GiniBankSDKPinning/.build/swift-create-xcframework/GiniBankSDKPinning.xcodeproj",
"resource_name": "CaptureSDKResources",
"target_name": "GiniCaptureSDK",
"resources_path": "../CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Resources",
"ci": "true"
}
- name: Archiving project
run: |
xcodebuild archive -project BankSDK/GiniBankSDKPinning/.build/swift-create-xcframework/GiniBankSDKPinning.xcodeproj \
-scheme GiniBankSDKPinning \
-sdk iphonesimulator \
-xcconfig Distribution.xcconfig \
-configuration Release \
-destination="iOS" \
-archivePath "iphonesimulatorPinning.xcarchive" SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
xcodebuild clean archive -project BankSDK/GiniBankSDKPinning/.build/swift-create-xcframework/GiniBankSDKPinning.xcodeproj \
-scheme GiniBankSDKPinning -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/GiniBankAPILibrary.framework \
-framework iphonesimulatorPinning.xcarchive/Products/Library/Frameworks/GiniBankAPILibrary.framework \
-output GiniBankAPILibrary.xcframework &&\
\
xcodebuild -create-xcframework \
-framework iphoneosPinning.xcarchive/Products/Library/Frameworks/GiniCaptureSDK.framework \
-framework iphonesimulatorPinning.xcarchive/Products/Library/Frameworks/GiniCaptureSDK.framework \
-output GiniCaptureSDK.xcframework &&\
\
xcodebuild -create-xcframework \
-framework iphoneosPinning.xcarchive/Products/Library/Frameworks/GiniBankSDK.framework \
-framework iphonesimulatorPinning.xcarchive/Products/Library/Frameworks/GiniBankSDK.framework \
-output GiniBankSDK.xcframework &&\
\
xcodebuild -create-xcframework \
-framework iphoneosPinning.xcarchive/Products/Library/Frameworks/GiniBankAPILibraryPinning.framework \
-framework iphonesimulatorPinning.xcarchive/Products/Library/Frameworks/GiniBankAPILibraryPinning.framework \
-output GiniBankAPILibraryPinning.xcframework && \
\
xcodebuild -create-xcframework \
-framework iphoneosPinning.xcarchive/Products/Library/Frameworks/GiniCaptureSDKPinning.framework \
-framework iphonesimulatorPinning.xcarchive/Products/Library/Frameworks/GiniCaptureSDKPinning.framework \
-output GiniCaptureSDKPinning.xcframework && \
\
xcodebuild -create-xcframework \
-framework iphoneosPinning.xcarchive/Products/Library/Frameworks/GiniBankSDKPinning.framework \
-framework iphonesimulatorPinning.xcarchive/Products/Library/Frameworks/GiniBankSDKPinning.framework \
-output GiniBankSDKPinning.xcframework && \
\
xcodebuild -create-xcframework \
-framework iphoneosPinning.xcarchive/Products/Library/Frameworks/TrustKit.framework \
-framework iphonesimulatorPinning.xcarchive/Products/Library/Frameworks/TrustKit.framework \
-output TrustKit.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_BANK_SDK_EXAMPLE_ADHOC_DISTRIBUTION_PROVISION_PROFILE }}
BUILD_PROVISION_PROFILE_EXTENSION_BASE64: ${{ secrets.GINI_BANK_SDK_EXTENSION_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
PP_PATH2=$RUNNER_TEMP/build_pp2.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
echo -n "$BUILD_PROVISION_PROFILE_EXTENSION_BASE64" | base64 --decode -o $PP_PATH2
# 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
cp $PP_PATH2 ~/Library/MobileDevice/Provisioning\ Profiles
# sign xcframeworks
codesign --timestamp -v --sign "Apple Distribution: Gini GmbH (JA825X8F7Z)" GiniBankAPILibrary.xcframework && \
codesign --timestamp -v --sign "Apple Distribution: Gini GmbH (JA825X8F7Z)" GiniCaptureSDK.xcframework && \
codesign --timestamp -v --sign "Apple Distribution: Gini GmbH (JA825X8F7Z)" GiniBankSDK.xcframework && \
codesign --timestamp -v --sign "Apple Distribution: Gini GmbH (JA825X8F7Z)" GiniBankAPILibraryPinning.xcframework && \
codesign --timestamp -v --sign "Apple Distribution: Gini GmbH (JA825X8F7Z)" GiniCaptureSDKPinning.xcframework && \
codesign --timestamp -v --sign "Apple Distribution: Gini GmbH (JA825X8F7Z)" GiniBankSDKPinning.xcframework
- name: archive frameworks GiniBankAPILibrary
uses: actions/upload-artifact@v4
with:
name: GiniBankSDKFramework
path: |
GiniBankAPILibrary.xcframework
GiniBankSDK.xcframework
GiniCaptureSDK.xcframework
TrustKit.xcframework
GiniBankSDKPinning.xcframework
GiniCaptureSDKPinning.xcframework
GiniBankAPILibraryPinning.xcframework