Skip to content

Commit 9962381

Browse files
authored
Added iOS Support to Komoju Payment SDK (#71)
* Added ios Support * Deleted Image * Lint fixup * Renamed ios to komoju-ios-sdk and the name of the framework is KomojuSDK in iOS * Added CI based lint checks * lint only for sdk * lint only for sdk * lint only for sdk * Added LICENSE and deployment steps * A few changes * A few changes
1 parent 39e865c commit 9962381

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+2796
-20
lines changed

.github/workflows/deploy.yml

+98-18
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,9 @@ permissions:
1313
contents: write
1414

1515
jobs:
16-
deploy-sdk:
17-
name: Deploy SDK
18-
strategy:
19-
matrix:
20-
include:
21-
# - target: publishIosArm64PublicationToSonatypeRepository
22-
# os: macos-latest
23-
- target: :shared:publishAllPublicationsToMavenCentralRepository
24-
os: ubuntu-latest
25-
- target: :komoju-android-sdk:publishAllPublicationsToMavenCentralRepository
26-
os: ubuntu-latest
27-
runs-on: ${{ matrix.os }}
16+
deploy-android-sdk:
17+
name: Deploy Android SDK
18+
runs-on: ubuntu-latest
2819
steps:
2920
- uses: actions/checkout@v4
3021
- name: Validate Gradle Wrapper
@@ -50,24 +41,28 @@ jobs:
5041
echo Version: TAG
5142
echo "SDK_VERSION=${TAG#v}" >> $GITHUB_ENV
5243
53-
- name: Deploy
54-
run: chmod +x gradlew && ./gradlew ${{ matrix.target }} --no-configuration-cache --no-daemon
44+
- name: Build & Deploy
45+
run: chmod +x gradlew && ./gradlew :shared:publishAllPublicationsToMavenCentralRepository :komoju-android-sdk:publishAllPublicationsToMavenCentralRepository --no-configuration-cache --no-daemon
5546
env:
5647
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }}
5748
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}
5849
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.MEMORY_KEY }}
5950
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
6051
SDK_VERSION: ${{ env.SDK_VERSION }}
6152

62-
63-
deploy-app:
53+
deploy-android-app:
6454
name: Deploy Android App
65-
needs: deploy-sdk
55+
needs: deploy-android-sdk
6656
runs-on: ubuntu-latest
6757
steps:
6858
- uses: actions/checkout@v4
6959
- name: Validate Gradle Wrapper
7060
uses: gradle/actions/wrapper-validation@v4
61+
- uses: actions/cache@v4
62+
with:
63+
path: |
64+
~/.konan
65+
key: ${{ runner.os }}-${{ hashFiles('**/.lock') }}
7166
- name: Set up JDK 17
7267
uses: actions/setup-java@v4
7368
with:
@@ -93,4 +88,89 @@ jobs:
9388
asset_name: soundBud-release.apk
9489
make_latest: false
9590
env:
96-
SDK_VERSION: ${{ env.SDK_VERSION }}
91+
SDK_VERSION: ${{ env.SDK_VERSION }}
92+
93+
deploy-ios-sdk:
94+
name: Deploy iOS SDK
95+
runs-on: macos-latest-xlarge
96+
steps:
97+
- uses: actions/checkout@v4
98+
- name: Validate Gradle Wrapper
99+
uses: gradle/actions/wrapper-validation@v4
100+
- uses: actions/cache@v4
101+
with:
102+
path: |
103+
~/.konan
104+
key: ${{ runner.os }}-${{ hashFiles('**/.lock') }}
105+
- uses: maxim-lobanov/setup-xcode@v1
106+
with:
107+
xcode-version: '16.0.0'
108+
- name: Set up JDK 17
109+
uses: actions/setup-java@v4
110+
with:
111+
distribution: zulu
112+
java-version: 17
113+
- name: Write release version
114+
run: |
115+
TAG=${{ github.event.release.tag_name }}
116+
echo Version: TAG
117+
echo "SDK_VERSION=${TAG#v}" >> $GITHUB_ENV
118+
- name: Build Shared SDK framework
119+
run: |
120+
chmod +x gradlew && ./gradlew :shared:linkReleaseFrameworkIosArm64 :shared:linkReleaseFrameworkIosSimulatorArm64 --no-configuration-cache --no-daemon
121+
122+
rm -rf ./build/outputs/xcframework/KomojuSharedSDK.xcframework
123+
124+
xcodebuild -create-xcframework \
125+
-framework ./shared/build/bin/iosArm64/releaseFramework/komojuShared.framework \
126+
-framework ./shared/build/bin/iosSimulatorArm64/releaseFramework/komojuShared.framework \
127+
-output ./build/outputs/xcframework/KomojuSharedSDK.xcframework
128+
129+
zip -r KomojuSharedSDK.zip ./build/outputs/xcframework/KomojuSharedSDK.xcframework
130+
131+
- name: Build Shared SDK Swift Wrapper
132+
working-directory: ./komoju-ios-sdk
133+
run: |
134+
# Build & Archive for iOS
135+
xcodebuild archive \
136+
-scheme KomojuSDK \
137+
-configuration Release \
138+
-destination "generic/platform=iOS" \
139+
-archivePath "./build/xcframework/komoju_ios.xcarchive" \
140+
-sdk iphoneos \
141+
ONLY_ACTIVE_ARCH=NO \
142+
SKIP_INSTALL=NO \
143+
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
144+
145+
146+
# Build & Archive for iOS Simulator
147+
xcodebuild archive \
148+
-scheme KomojuSDK \
149+
-configuration Release \
150+
-destination "generic/platform=iOS Simulator" \
151+
-archivePath "./build/xcframework/komoju_ios_simulators.xcarchive" \
152+
-sdk iphonesimulator \
153+
ONLY_ACTIVE_ARCH=NO \
154+
SKIP_INSTALL=NO \
155+
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
156+
157+
rm -rf ./build/outputs/xcframework/KomojuIosSDK.xcframework
158+
159+
xcodebuild -create-xcframework \
160+
-framework ./build/xcframework/komoju_ios.xcarchive/Products/Library/Frameworks/KomojuSDK.framework \
161+
-framework ./build/xcframework/komoju_ios_simulators.xcarchive/Products/Library/Frameworks/KomojuSDK.framework \
162+
-output ./build/outputs/xcframework/KomojuIosSDK.xcframework
163+
164+
zip -r KomojuIosSDK.zip ./build/outputs/xcframework/KomojuIosSDK.xcframework
165+
- name: Publish Shared SDK Framework!
166+
uses: svenstaro/upload-release-action@v2
167+
with:
168+
repo_token: ${{ secrets.GITHUB_TOKEN }}
169+
file: KomojuSharedSDK.zip
170+
make_latest: false
171+
- name: Publish iOS SDK Framework!
172+
uses: svenstaro/upload-release-action@v2
173+
with:
174+
repo_token: ${{ secrets.GITHUB_TOKEN }}
175+
file: komoju-ios-sdk/KomojuIosSDK.zip
176+
make_latest: false

.github/workflows/verify.yml

+14-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Verify PR
22

33
on:
44
pull_request:
5-
types: [opened, synchronize, reopened, ready_for_review]
5+
types: [ opened, synchronize, reopened, ready_for_review ]
66

77
concurrency:
88
group: github-${{ github.ref }}
@@ -42,4 +42,16 @@ jobs:
4242
distribution: zulu
4343
java-version: 17
4444
- name: Run Gradle
45-
run: ./gradlew :komoju-android-sdk:lintDebug
45+
run: ./gradlew :komoju-android-sdk:lintDebug
46+
swiftlint:
47+
runs-on: ubuntu-latest
48+
name: SwiftLint
49+
if: github.event.pull_request.draft == false
50+
steps:
51+
- uses: actions/checkout@v1
52+
- name: swiftLint on ios sdk
53+
uses: norio-nomura/action-swiftlint@3.2.1
54+
with:
55+
args: --strict
56+
env:
57+
WORKING_DIRECTORY: komoju-ios-sdk

example-ios/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dev.xcconfig
2+
live.xcconfig

0 commit comments

Comments
 (0)