Skip to content

Commit

Permalink
icerockdev#51 ci fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex009 committed Sep 29, 2024
1 parent 575098b commit 528393a
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 30 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/compilation-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,11 @@ jobs:
runs-on: macOS-latest

steps:
- uses: actions/checkout@v1
- name: Set up JDK 11
uses: actions/setup-java@v1
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 11
- name: Build and publish local
run: ./gradlew build publishToMavenLocal syncMultiPlatformLibraryDebugFrameworkIosX64
- name: Install pods
run: cd sample/ios-app && pod install
- name: Check iOS
run: cd sample/ios-app && set -o pipefail && xcodebuild -scheme TestProj -workspace TestProj.xcworkspace -configuration Debug -sdk iphonesimulator -arch x86_64 build CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO | xcpretty
java-version: 17
distribution: zulu
- name: Check
run: ./local-check.sh
9 changes: 5 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ jobs:
SIGNING_KEY: ${{ secrets.GPG_KEY_CONTENTS }}

steps:
- uses: actions/checkout@v1
- name: Set up JDK 11
uses: actions/setup-java@v1
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 11
java-version: 17
distribution: zulu
- name: Publish
run: ./gradlew publish

Expand Down
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
kotlinVersion = "1.9.23"
kotlinVersion = "1.9.25"
androidAppCompatVersion = "1.6.1"
materialDesignVersion = "1.8.0"
androidLifecycleVersion = "2.2.0"
Expand Down Expand Up @@ -30,6 +30,6 @@ androidCoreTesting = { module = "androidx.arch.core:core-testing", version.ref =

# gradle plugins
kotlinGradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlinVersion" }
androidGradlePlugin = { module = "com.android.tools.build:gradle", version = "7.4.2" }
androidGradlePlugin = { module = "com.android.tools.build:gradle", version = "8.3.2" }
mokoResourcesGradlePlugin = { module = "dev.icerock.moko:resources-generator", version.ref = "mokoResourcesVersion" }
mokoGradlePlugin = { module = "dev.icerock.moko:moko-gradle-plugin", version = "0.3.0" }
mokoGradlePlugin = { module = "dev.icerock.moko:moko-gradle-plugin", version = "0.4.0" }
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Apr 16 13:01:03 NOVT 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
37 changes: 37 additions & 0 deletions local-check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#
# Copyright 2024 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
#

set -e

log() {
echo "\033[0;32m> $1\033[0m"
}

./gradlew detekt
log "detekt success"

./gradlew assembleDebug
log "android success"

./gradlew compileKotlinIosX64
log "ios success"

./gradlew build publishToMavenLocal
log "full build success"

if ! command -v xcodebuild &> /dev/null
then
log "xcodebuild could not be found, skip ios checks"
else
./gradlew syncMultiPlatformLibraryDebugFrameworkIosX64
log "sync success"

(
cd sample/ios-app &&
pod install &&
set -o pipefail &&
xcodebuild -scheme TestProj -workspace TestProj.xcworkspace -configuration Debug -sdk iphonesimulator -arch x86_64 build CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO | xcpretty
)
log "ios xcode success"
fi
2 changes: 1 addition & 1 deletion sample/ios-app/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ EXTERNAL SOURCES:
:path: "../mpp-library"

SPEC CHECKSUMS:
MultiPlatformLibrary: 2a9f43df7bd018c32611a2087c1e2ef74847394c
MultiPlatformLibrary: 050151f1b2e9b2dcfff0763bb625fb3a0a063076

PODFILE CHECKSUM: e8746dc30e9d53a96c59e8f821148cde03ea8c5b

Expand Down
15 changes: 5 additions & 10 deletions sample/mpp-library/MultiPlatformLibrary.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Pod::Spec.new do |spec|
'KOTLIN_FRAMEWORK_BUILD_TYPE[config=*elease]' => 'release',
'CURENT_SDK[sdk=iphoneos*]' => 'iphoneos',
'CURENT_SDK[sdk=iphonesimulator*]' => 'iphonesimulator',
'CURENT_SDK[sdk=macosx*]' => 'macos'
}

spec.script_phases = [
Expand All @@ -37,21 +36,17 @@ fi
if [ "$CURENT_SDK" == "iphoneos" ]; then
TARGET="Ios"
ARCH="Arm64"
elif [ "$CURENT_SDK" == "macos" ]; then
TARGET="Macos"
if [ "$NATIVE_ARCH" == "arm64" ]; then
ARCH="Arm64"
else
ARCH="X64"
fi
else
if [ "$NATIVE_ARCH" == "arm64" ]; then
elif [ "$CURENT_SDK" == "iphonesimulator" ]; then
if [ "$ARCHS" == "arm64" ]; then
TARGET="IosSimulator"
ARCH="Arm64"
else
TARGET="Ios"
ARCH="X64"
fi
else
echo "unsupported $CURENT_SDK"
exit 1
fi
MPP_PROJECT_ROOT="$SRCROOT/../../mpp-library"
Expand Down
1 change: 0 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* Copyright 2020 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
*/

enableFeaturePreview("VERSION_CATALOGS")
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")

dependencyResolutionManagement {
Expand Down

0 comments on commit 528393a

Please sign in to comment.