Skip to content

fix(GiniHealthAPILibrary): Fix entitlements file #175

fix(GiniHealthAPILibrary): Fix entitlements file

fix(GiniHealthAPILibrary): Fix entitlements file #175

name: Build BankSDK XCFrameworks
on:
push:
tags:
- 'GiniBankSDK;[0-9]+.[0-9]+.[0-9]+;xcframeworks**'
workflow_call:
jobs:
prepare-frameworks:
name: Create Release
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- 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: 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 }}
KEYCHAIN_PASSWORD: ${{ secrets.GINI_DISTRIBUTION_CERTIFICATE_SECRET }}
run: |
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# import certificate and provisioning profile from secrets
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode --output $PP_PATH
# 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_PATH ~/Library/MobileDevice/Provisioning\ Profiles
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@v2
with:
name: GiniBankSDKFramework
path: |
GiniBankAPILibrary.xcframework
GiniBankSDK.xcframework
GiniCaptureSDK.xcframework
TrustKit.xcframework
GiniBankSDKPinning.xcframework
GiniCaptureSDKPinning.xcframework
GiniBankAPILibraryPinning.xcframework