-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'main' into PM-129-expose-function-to-cl…
…ose-the-bank-sdk
- Loading branch information
Showing
108 changed files
with
3,753 additions
and
454 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/bin/bash | ||
|
||
set -o pipefail | ||
|
||
# Required since https://github.blog/2022-04-12-git-security-vulnerability-announced | ||
git config --global --add safe.directory $GITHUB_WORKSPACE | ||
|
||
RELEASE_NOTES="" | ||
RELEASE_NOTES_FILE="" | ||
|
||
TOKEN_DEPRECATED_WARNING_MESSAGE="⚠ This action will stop working with the next future major version of firebase-tools! Migrate to Service Account. See more: https://github.com/wzieba/Firebase-Distribution-Github-Action/wiki/FIREBASE_TOKEN-migration" | ||
|
||
if [[ -z ${INPUT_RELEASENOTES} ]]; then | ||
RELEASE_NOTES="$(git log -1 --pretty=short)" | ||
else | ||
RELEASE_NOTES=${INPUT_RELEASENOTES} | ||
fi | ||
|
||
if [[ ${INPUT_RELEASENOTESFILE} ]]; then | ||
RELEASE_NOTES="" | ||
RELEASE_NOTES_FILE=${INPUT_RELEASENOTESFILE} | ||
fi | ||
|
||
if [ -n "${INPUT_SERVICECREDENTIALSFILE}" ] ; then | ||
export GOOGLE_APPLICATION_CREDENTIALS="${INPUT_SERVICECREDENTIALSFILE}" | ||
fi | ||
|
||
if [ -n "${INPUT_SERVICECREDENTIALSFILECONTENT}" ] ; then | ||
cat <<< "${INPUT_SERVICECREDENTIALSFILECONTENT}" > service_credentials_content.json | ||
export GOOGLE_APPLICATION_CREDENTIALS="service_credentials_content.json" | ||
fi | ||
|
||
if [ -n "${INPUT_TOKEN}" ] ; then | ||
echo ${TOKEN_DEPRECATED_WARNING_MESSAGE} | ||
export FIREBASE_TOKEN="${INPUT_TOKEN}" | ||
fi | ||
|
||
firebase \ | ||
appdistribution:distribute \ | ||
"$INPUT_FILE" \ | ||
--app "$INPUT_APPID" \ | ||
--groups "$INPUT_GROUPS" \ | ||
--testers "$INPUT_TESTERS" \ | ||
${RELEASE_NOTES:+ --release-notes "${RELEASE_NOTES}"} \ | ||
${INPUT_RELEASENOTESFILE:+ --release-notes-file "${RELEASE_NOTES_FILE}"} \ | ||
$( (( $INPUT_DEBUG )) && printf %s '--debug' ) | | ||
{ | ||
while read -r line; do | ||
echo $line | ||
|
||
if [[ $line == *"View this release in the Firebase console"* ]]; then | ||
CONSOLE_URI=$(echo "$line" | sed -e 's/.*: //' -e 's/^ *//;s/ *$//') | ||
echo "FIREBASE_CONSOLE_URI=$CONSOLE_URI" >>"$GITHUB_OUTPUT" | ||
elif [[ $line == *"Share this release with testers who have access"* ]]; then | ||
TESTING_URI=$(echo "$line" | sed -e 's/.*: //' -e 's/^ *//;s/ *$//') | ||
echo "TESTING_URI=$TESTING_URI" >>"$GITHUB_OUTPUT" | ||
elif [[ $line == *"Download the release binary"* ]]; then | ||
BINARY_URI=$(echo "$line" | sed -e 's/.*: //' -e 's/^ *//;s/ *$//') | ||
echo "BINARY_DOWNLOAD_URI=$BINARY_URI" >>"$GITHUB_OUTPUT" | ||
fi | ||
done | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,13 +116,47 @@ jobs: | |
files: "*.ipa" | ||
fail: true | ||
|
||
- name: Install Node.js 20.x | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- run: npm install -g [email protected] | ||
shell: bash | ||
|
||
- name: Distribute bank-sdk example ipa to Firebase App Distribution | ||
uses: emertozd/Firebase-Distribution-Github-Action@v2 | ||
id: distribute | ||
run: | | ||
chmod +x .github/publish_to_firebase.sh | ||
.github/publish_to_firebase.sh | ||
shell: bash | ||
env: | ||
INPUT_APPID: ${{ secrets.GINI_BANK_SDK_EXAMPLE_APP_FIREBASE_ID }} | ||
INPUT_SERVICECREDENTIALSFILECONTENT: ${{ secrets.FIREBASE_CREDENTIAL_FILE_CONTENT }} | ||
INPUT_FILE: GiniBankSDKExample.ipa | ||
INPUT_GROUPS: testers | ||
INPUT_RELEASENOTES: | | ||
${{ format('{{ {0} {1} }}', github.ref, github.sha) }} | ||
${{ github.event.head_commit.message }} | ||
- name: Extract Jira ticket | ||
id: extract_jira_ticket | ||
run: | | ||
commit_message=$(git log -1 --pretty=%B) | ||
jira_ticket=$(echo "$commit_message" | awk 'NR > 1 && $0 != "" { print $0; exit }') | ||
echo "JIRA_TICKET_NAME=${jira_ticket}" >> $GITHUB_ENV | ||
- name: Login to jira | ||
if: ${{ env.JIRA_TICKET_NAME != null }} | ||
uses: justin-jhg/gajira-login@v1 | ||
env: | ||
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} | ||
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} | ||
JIRA_API_TOKEN: ${{ secrets.JIRA_API_KEY }} | ||
|
||
- name: Comment on issue | ||
if: ${{ env.JIRA_TICKET_NAME != null }} | ||
uses: atlassian/gajira-comment@v3 | ||
with: | ||
appId: ${{ secrets.GINI_BANK_SDK_EXAMPLE_APP_FIREBASE_ID }} | ||
serviceCredentialsFileContent: ${{ secrets.FIREBASE_CREDENTIAL_FILE_CONTENT }} | ||
groups: testers | ||
file: GiniBankSDKExample.ipa | ||
releaseNotes: | | ||
${{ format('{{ {0} {1} }}', github.ref, github.sha) }} | ||
${{ github.event.head_commit.message }} | ||
issue: ${{ env.JIRA_TICKET_NAME }} | ||
comment: Build bank example app ${{ steps.distribute.outputs.FIREBASE_CONSOLE_URI }} |
79 changes: 79 additions & 0 deletions
79
.github/workflows/health-sdk.build.xcframeworks.xcode16.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: Build HealthSDK XCFrameworks XCode 16 | ||
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-15 | ||
steps: | ||
- uses: maxim-lobanov/[email protected] | ||
with: | ||
xcode-version: '16.2' | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Archiving project and creating XCFrameworks | ||
run: | | ||
./build-healthsdk.sh | ||
- 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)" GiniInternalPaymentSDK.xcframework && \ | ||
codesign --timestamp -v --sign "Apple Distribution: Gini GmbH (JA825X8F7Z)" GiniUtilites.xcframework | ||
- name: archive frameworks GiniHealthAPILibrary | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: GiniHealthSDKFramework | ||
path: | | ||
GiniHealthAPILibrary.xcframework | ||
GiniHealthSDK.xcframework | ||
GiniInternalPaymentSDK.xcframework | ||
GiniUtilites.xcframework | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,85 +18,18 @@ on: | |
jobs: | ||
prepare-frameworks: | ||
name: Create Release | ||
runs-on: macos-13 | ||
runs-on: macos-14 | ||
steps: | ||
- uses: maxim-lobanov/[email protected] | ||
with: | ||
xcode-version: '14.3.1' | ||
xcode-version: '15.4' | ||
|
||
- 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: GiniHealthSDKPinning Project File | ||
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 | ||
- name: Archiving project and creating 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 | ||
./build-healthsdk.sh | ||
- name: Sign the XCFrameworks | ||
env: | ||
|
@@ -131,8 +64,8 @@ jobs: | |
# 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 | ||
codesign --timestamp -v --sign "Apple Distribution: Gini GmbH (JA825X8F7Z)" GiniInternalPaymentSDK.xcframework && \ | ||
codesign --timestamp -v --sign "Apple Distribution: Gini GmbH (JA825X8F7Z)" GiniUtilites.xcframework | ||
- name: archive frameworks GiniHealthAPILibrary | ||
uses: actions/upload-artifact@v4 | ||
|
@@ -141,6 +74,6 @@ jobs: | |
path: | | ||
GiniHealthAPILibrary.xcframework | ||
GiniHealthSDK.xcframework | ||
GiniHealthSDKPinning.xcframework | ||
GiniHealthAPILibraryPinning.xcframework | ||
GiniInternalPaymentSDK.xcframework | ||
GiniUtilites.xcframework | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,9 +73,11 @@ jobs: | |
- name: Setup Credentials | ||
run: | | ||
plutil -replace client_id -string "gini-mobile-test" HealthSDK/GiniHealthSDKExample/GiniHealthSDKExample/CredentialsManager.swift | ||
plutil -replace client_password -string "${{ secrets.GINI_MOBILE_TEST_CLIENT_SECRET }}" HealthSDK/GiniHealthSDKExample/GiniHealthSDKExample/CredentialsManager.swift | ||
sed -i '' \ | ||
-e 's/clientID = "client_id"/clientID = "gini-mobile-test"/' \ | ||
-e 's/clientPassword = "client_password"/clientPassword = "${{ secrets.GINI_MOBILE_TEST_CLIENT_SECRET }}"/' \ | ||
HealthSDK/GiniHealthSDKExample/GiniHealthSDKExample/CredentialsManager.swift | ||
- name: Archiving project | ||
run: | | ||
xcodebuild clean archive \ | ||
|
@@ -107,14 +109,48 @@ jobs: | |
with: | ||
files: "*.ipa" | ||
fail: true | ||
|
||
|
||
- name: Install Node.js 20.x | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- run: npm install -g [email protected] | ||
shell: bash | ||
|
||
- name: Distribute health-sdk example ipa to Firebase App Distribution | ||
uses: emertozd/Firebase-Distribution-Github-Action@v2 | ||
id: distribute | ||
run: | | ||
chmod +x .github/publish_to_firebase.sh | ||
.github/publish_to_firebase.sh | ||
shell: bash | ||
env: | ||
INPUT_APPID: ${{ secrets.GINI_HEALTH_SDK_EXAMPLE_APP_FIREBASE_ID }} | ||
INPUT_SERVICECREDENTIALSFILECONTENT: ${{ secrets.FIREBASE_CREDENTIAL_FILE_CONTENT }} | ||
INPUT_FILE: GiniHealthSDKExample.ipa | ||
INPUT_GROUPS: testers | ||
INPUT_RELEASENOTES: | | ||
${{ format('{{ {0} {1} }}', github.ref, github.sha) }} | ||
${{ github.event.head_commit.message }} | ||
- name: Extract Jira ticket | ||
id: extract_jira_ticket | ||
run: | | ||
commit_message=$(git log -1 --pretty=%B) | ||
jira_ticket=$(echo "$commit_message" | awk 'NR > 1 && $0 != "" { print $0; exit }') | ||
echo "JIRA_TICKET_NAME=${jira_ticket}" >> $GITHUB_ENV | ||
- name: Login to jira | ||
if: ${{ env.JIRA_TICKET_NAME != null }} | ||
uses: justin-jhg/gajira-login@v1 | ||
env: | ||
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} | ||
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} | ||
JIRA_API_TOKEN: ${{ secrets.JIRA_API_KEY }} | ||
|
||
- name: Comment on issue | ||
if: ${{ env.JIRA_TICKET_NAME != null }} | ||
uses: atlassian/gajira-comment@v3 | ||
with: | ||
appId: ${{ secrets.GINI_HEALTH_SDK_EXAMPLE_APP_FIREBASE_ID }} | ||
serviceCredentialsFileContent: ${{ secrets.FIREBASE_CREDENTIAL_FILE_CONTENT }} | ||
groups: testers | ||
file: GiniHealthSDKExample.ipa | ||
releaseNotes: | | ||
${{ format('{{ {0} {1} }}', github.ref, github.sha) }} | ||
${{ github.event.head_commit.message }} | ||
issue: ${{ env.JIRA_TICKET_NAME }} | ||
comment: Build health example app ${{ steps.distribute.outputs.FIREBASE_CONSOLE_URI }} |
Oops, something went wrong.