-
Notifications
You must be signed in to change notification settings - Fork 2
133 lines (116 loc) · 5.39 KB
/
bank-sdk.publish.example.app.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
name: Publish GiniBankSDKExample to App Center
on:
push:
paths:
- 'BankSDK/**'
- 'CaptureSDK/**'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-publish
cancel-in-progress: ${{ !contains(github.ref, 'refs/tags/')}}
jobs:
check:
uses: ./.github/workflows/bank-sdk.check.yml
secrets:
GINI_MOBILE_TEST_CLIENT_SECRET: ${{ secrets.GINI_MOBILE_TEST_CLIENT_SECRET }}
upload-version:
needs: check
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: maxim-lobanov/[email protected]
with:
xcode-version: '15.3'
- name: Setup provisioning profile
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: |
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 --output $CERTIFICATE_PATH
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode --output $PP_PATH1
echo -n "$BUILD_PROVISION_PROFILE_EXTENSION_BASE64" | base64 --decode --output $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
- name: Setup Manual Signing for Xcode project
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2.0'
bundler-cache: true
- uses: maierj/[email protected]
with:
lane: 'setup_manual_signing'
options: >
{
"project_path":"BankSDK/GiniBankSDKExample/GiniBankSDKExample.xcodeproj",
"team_id":"JA825X8F7Z",
"target":"GiniBankSDKExample",
"target_extension": "GiniBankSDKShareExtension",
"bundle_identifier": "net.gini.banksdk.example",
"bundle_identifier_extension": "net.gini.banksdk.example.ShareExtension",
"profile_name": "Gini Bank SDK Example App Ad-Hoc Distribution",
"profile_name_extension" : "Gini Bank SDK Share Extension Ad-Hoc Distribution",
"entitlements_file_path": "GiniBankSDKExample/Example Swift.entitlements",
"entitlements_file_path_extension": "GiniBankSDKShareExtension/GiniBankSDKShareExtension.entitlements",
"ci": "true"
}
- name: Setup Credentials
run: |
plutil -replace client_id -string "gini-mobile-test" BankSDK/GiniBankSDKExample/GiniBankSDKExample/Credentials.plist
plutil -replace client_password -string "${{ secrets.GINI_MOBILE_TEST_CLIENT_SECRET }}" BankSDK/GiniBankSDKExample/GiniBankSDKExample/Credentials.plist
- name: Archiving project
run: |
xcodebuild clean archive \
-workspace GiniMobile.xcworkspace \
-scheme "GiniBankSDKExample" \
-archivePath ./GiniBankSDKExample.xcarchive \
-configuration Release \
-destination generic/platform=iOS \
CODE_SIGN_IDENTITY="Apple Distribution" \
CODE_SIGNING_REQUIRED=NO \
ONLY_ACTIVE_ARCH=NO \
CODE_SIGN_STYLE=Manual \
DEVELOPMENT_TEAM=JA825X8F7Z
- name: Exporting .ipa
run: |
xcodebuild \
-exportArchive \
-archivePath GiniBankSDKExample.xcarchive \
-exportPath . \
-exportOptionsPlist ExportOptions.plist \
-destination "generic/platform=iOS" \
CODE_SIGNING_REQUIRED=YES \
ONLY_ACTIVE_ARCH=NO \
CODE_SIGN_STYLE=Manual
- name: Check file existence
uses: andstor/file-existence-action@v3
with:
files: "*.ipa"
- name: Install appcenter-cli
run: |
npm install -g appcenter-cli
- name: Distribute ipa to App Center
uses: akiojin/[email protected]
with:
token: ${{ secrets.GINI_APPCENTER_API_TOKEN }}
path: GiniBankSDKExample.ipa
app: Gini-Team-Organization/Example-Gini-Pay-Bank-SDK
group: 'Internal'
release_notes: ${{ format('{{ {0} {1} }}', github.ref, github.sha) }}