From cb240d5d34c2cd5b84a6e0e828723164be6590cf Mon Sep 17 00:00:00 2001 From: amnix Date: Tue, 19 Nov 2024 17:12:17 +0900 Subject: [PATCH] Added LICENSE and deployment steps --- .github/workflows/deploy.yml | 112 +++++++++++++++++++++++++++++------ komoju-ios-sdk/.gitignore | 1 + komoju-ios-sdk/LICENSE | 21 +++++++ 3 files changed, 117 insertions(+), 17 deletions(-) create mode 100644 komoju-ios-sdk/.gitignore create mode 100644 komoju-ios-sdk/LICENSE diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 0568025..3716492 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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 @@ -50,8 +41,8 @@ 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 }} @@ -59,10 +50,9 @@ jobs: 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 @@ -92,5 +82,93 @@ jobs: file: example-android/build/outputs/apk/dev/release/example-android-dev-release.apk asset_name: soundBud-release.apk make_latest: false + env: + SDK_VERSION: ${{ env.SDK_VERSION }} + + deploy-ios-sdk: + name: Deploy iOS SDK + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - name: Validate Gradle Wrapper + uses: gradle/actions/wrapper-validation@v4 + - 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-$SDK_VERSION.zip ./build/outputs/xcframework/KomojuSharedSDK.xcframework + + env: + SDK_VERSION: ${{ env.SDK_VERSION }} + - name: Build iOS SDK 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-$SDK_VERSION.zip ./build/outputs/xcframework/KomojuIosSDK.xcframework + env: + SDK_VERSION: ${{ env.SDK_VERSION }} + - name: Publish Shared SDK Framework! + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: KomojuSharedSDK-$SDK_VERSION.zip + make_latest: false + env: + SDK_VERSION: ${{ env.SDK_VERSION }} + - name: Publish iOS SDK Framework! + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: KomojuIosSDK-$SDK_VERSION.zip + make_latest: false env: SDK_VERSION: ${{ env.SDK_VERSION }} \ No newline at end of file diff --git a/komoju-ios-sdk/.gitignore b/komoju-ios-sdk/.gitignore new file mode 100644 index 0000000..d239d6a --- /dev/null +++ b/komoju-ios-sdk/.gitignore @@ -0,0 +1 @@ +xcframework/** \ No newline at end of file diff --git a/komoju-ios-sdk/LICENSE b/komoju-ios-sdk/LICENSE new file mode 100644 index 0000000..be57f08 --- /dev/null +++ b/komoju-ios-sdk/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Degica + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.