Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added iOS Support to Komoju Payment SDK #71

Merged
merged 11 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 98 additions & 18 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,9 @@ permissions:
contents: write

jobs:
deploy-sdk:
name: Deploy SDK
strategy:
matrix:
include:
# - target: publishIosArm64PublicationToSonatypeRepository
# os: macos-latest
- target: :shared:publishAllPublicationsToMavenCentralRepository
os: ubuntu-latest
- target: :komoju-android-sdk:publishAllPublicationsToMavenCentralRepository
os: ubuntu-latest
runs-on: ${{ matrix.os }}
deploy-android-sdk:
name: Deploy Android SDK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate Gradle Wrapper
Expand All @@ -50,24 +41,28 @@ jobs:
echo Version: TAG
echo "SDK_VERSION=${TAG#v}" >> $GITHUB_ENV

- name: Deploy
run: chmod +x gradlew && ./gradlew ${{ matrix.target }} --no-configuration-cache --no-daemon
- name: Build & Deploy
run: chmod +x gradlew && ./gradlew :shared:publishAllPublicationsToMavenCentralRepository :komoju-android-sdk:publishAllPublicationsToMavenCentralRepository --no-configuration-cache --no-daemon
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.MEMORY_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
SDK_VERSION: ${{ env.SDK_VERSION }}


deploy-app:
deploy-android-app:
name: Deploy Android App
needs: deploy-sdk
needs: deploy-android-sdk
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v4
- uses: actions/cache@v4
with:
path: |
~/.konan
key: ${{ runner.os }}-${{ hashFiles('**/.lock') }}
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
Expand All @@ -93,4 +88,89 @@ jobs:
asset_name: soundBud-release.apk
make_latest: false
env:
SDK_VERSION: ${{ env.SDK_VERSION }}
SDK_VERSION: ${{ env.SDK_VERSION }}

deploy-ios-sdk:
name: Deploy iOS SDK
runs-on: macos-latest-xlarge
steps:
- uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v4
- uses: actions/cache@v4
with:
path: |
~/.konan
key: ${{ runner.os }}-${{ hashFiles('**/.lock') }}
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '16.0.0'
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
- name: Write release version
run: |
TAG=${{ github.event.release.tag_name }}
echo Version: TAG
echo "SDK_VERSION=${TAG#v}" >> $GITHUB_ENV
- name: Build Shared SDK framework
run: |
chmod +x gradlew && ./gradlew :shared:linkReleaseFrameworkIosArm64 :shared:linkReleaseFrameworkIosSimulatorArm64 --no-configuration-cache --no-daemon

rm -rf ./build/outputs/xcframework/KomojuSharedSDK.xcframework

xcodebuild -create-xcframework \
-framework ./shared/build/bin/iosArm64/releaseFramework/komojuShared.framework \
-framework ./shared/build/bin/iosSimulatorArm64/releaseFramework/komojuShared.framework \
-output ./build/outputs/xcframework/KomojuSharedSDK.xcframework

zip -r KomojuSharedSDK.zip ./build/outputs/xcframework/KomojuSharedSDK.xcframework

- name: Build Shared SDK Swift Wrapper
working-directory: ./komoju-ios-sdk
run: |
# Build & Archive for iOS
xcodebuild archive \
-scheme KomojuSDK \
-configuration Release \
-destination "generic/platform=iOS" \
-archivePath "./build/xcframework/komoju_ios.xcarchive" \
-sdk iphoneos \
ONLY_ACTIVE_ARCH=NO \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES


# Build & Archive for iOS Simulator
xcodebuild archive \
-scheme KomojuSDK \
-configuration Release \
-destination "generic/platform=iOS Simulator" \
-archivePath "./build/xcframework/komoju_ios_simulators.xcarchive" \
-sdk iphonesimulator \
ONLY_ACTIVE_ARCH=NO \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES

rm -rf ./build/outputs/xcframework/KomojuIosSDK.xcframework

xcodebuild -create-xcframework \
-framework ./build/xcframework/komoju_ios.xcarchive/Products/Library/Frameworks/KomojuSDK.framework \
-framework ./build/xcframework/komoju_ios_simulators.xcarchive/Products/Library/Frameworks/KomojuSDK.framework \
-output ./build/outputs/xcframework/KomojuIosSDK.xcframework

zip -r KomojuIosSDK.zip ./build/outputs/xcframework/KomojuIosSDK.xcframework
- name: Publish Shared SDK Framework!
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: KomojuSharedSDK.zip
make_latest: false
- name: Publish iOS SDK Framework!
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: komoju-ios-sdk/KomojuIosSDK.zip
make_latest: false
16 changes: 14 additions & 2 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Verify PR

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
types: [ opened, synchronize, reopened, ready_for_review ]

concurrency:
group: github-${{ github.ref }}
Expand Down Expand Up @@ -42,4 +42,16 @@ jobs:
distribution: zulu
java-version: 17
- name: Run Gradle
run: ./gradlew :komoju-android-sdk:lintDebug
run: ./gradlew :komoju-android-sdk:lintDebug
swiftlint:
runs-on: ubuntu-latest
name: SwiftLint
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v1
- name: swiftLint on ios sdk
uses: norio-nomura/[email protected]
with:
args: --strict
env:
WORKING_DIRECTORY: komoju-ios-sdk
2 changes: 2 additions & 0 deletions example-ios/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dev.xcconfig
live.xcconfig
Loading