Skip to content

Commit

Permalink
Merge pull request #45 from allegro/feature/ios-release-scripts
Browse files Browse the repository at this point in the history
Modify release scripts for new modules, bump kotlin version
  • Loading branch information
pavlo-davydiuk committed Apr 21, 2022
2 parents f4b58ab + ac3ce1e commit 7f80a42
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ jobs:
run: ./gradlew build

- name: Build XCFramework
run: ./gradlew assembleJsonLogicKMPXCFramework
run: ./gradlew assembleJsonLogicCoreXCFramework assembleJsonLogicOperationsApiXCFramework assembleJsonLogicOperationsStdlibXCFramework
20 changes: 14 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ on:

env:
podspec_name: "JsonLogicKMP.podspec"
xcframework_name: "JsonLogicKMP.xcframework"
xcframework_zip_name: "JsonLogicKMP.xcframework.zip"
xcframework_artifact_key: "xcframework"
xcframework_zip_name: "JsonLogicKMP_xcframeworks.zip"
xcframework_artifact_key: "xcframeworks"

jobs:
run_tests:
Expand Down Expand Up @@ -43,19 +42,28 @@ jobs:
name: Build XCFramework
runs-on: macos-latest
needs: [run_tests]
env:
operations_api_xcframework_path: "operations-api/build/XCFrameworks/release/JsonLogicOperationsApi.xcframework"
operations_stdlib_xcframework_path: "operations-stdlib/build/XCFrameworks/release/JsonLogicOperationsStdlib.xcframework"
core_xcframework_path: "core/build/XCFrameworks/release/JsonLogicCore.xcframework"
outputs:
sha256: ${{ steps.calculate_checksum.outputs.sha256 }}
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Build XCFramework
run: ./gradlew assembleJsonLogicKMPXCFramework
run: ./gradlew assembleJsonLogicCoreXCFramework assembleJsonLogicOperationsApiXCFramework assembleJsonLogicOperationsStdlibXCFramework

- name: Zip XCFramework
run: |
mv "build/XCFrameworks/release/${{ env.xcframework_name }}" .
zip -r "${{ env.xcframework_zip_name }}" "${{ env.xcframework_name }}" LICENSE
mkdir filesToZip
mv "${{ env.operations_api_xcframework_path }}" filesToZip
mv "${{ env.operations_stdlib_xcframework_path }}" filesToZip
mv "${{ env.core_xcframework_path }}" filesToZip
mv LICENSE filesToZip
cd filesToZip
zip -r "../${{ env.xcframework_zip_name }}" *
- name: Calculate checksum
id: calculate_checksum
Expand Down
15 changes: 13 additions & 2 deletions JsonLogicKMP.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,20 @@ Pod::Spec.new do |spec|
spec.platform = :ios
spec.ios.deployment_target = "13.0"

spec.source = { :http => "#{spec.homepage}/releases/download/#{spec.version}/#{spec.name}.xcframework.zip",
spec.source = { :http => "#{spec.homepage}/releases/download/#{spec.version}/#{spec.name}_xcframeworks.zip",
:sha256 => "2690aa18597184eb96cabe2239210ec36e574af20cb5ddc18bdb9b8b4252f577"
}

spec.vendored_frameworks = "#{spec.name}.xcframework"
spec.subspec 'OperationsApi' do |operationsApi|
operationsApi.vendored_frameworks = "JsonLogicOperationsApi.xcframework"
end

spec.subspec 'OperationsStdlib' do |operationsStdlib|
operationsStdlib.vendored_frameworks = "JsonLogicOperationsStdlib.xcframework"
end

spec.subspec 'Core' do |core|
core.vendored_frameworks = "JsonLogicCore.xcframework"
end

end
9 changes: 7 additions & 2 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@ object LibConfig {
}

object Modules {
object XCFrameworkNames {
const val operationsStdlib = "JsonLogicOperationsStdlib"
const val operationsApi = "JsonLogicOperationsApi"
const val core = "JsonLogicCore"
}

const val operationsApi = ":operations-api"
const val utils = ":utils"
}

object Versions {
const val kotlin = "1.6.10"
const val kotlin = "1.6.20"
const val axion = "1.13.6"
const val detekt = "1.19.0"
const val nexus = "1.0.0"
Expand Down Expand Up @@ -43,5 +49,4 @@ object Libs {
object Conventions {
const val junit = "junit-convention"
const val publishing = "publishing-convention"
const val xcframeworkAssemble = "xcframework-assemble-convention"
}

This file was deleted.

5 changes: 2 additions & 3 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ kotlin {
}
}

val xcFramework = XCFramework(LibConfig.name)
val xcFramework = XCFramework(Modules.XCFrameworkNames.core)
listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
).forEach {
it.binaries.framework {
baseName = LibConfig.name
baseName = Modules.XCFrameworkNames.core
isStatic = true
xcFramework.add(this)
}
Expand Down Expand Up @@ -66,4 +66,3 @@ kotlin {
}
}
}
apply(plugin = Conventions.xcframeworkAssemble)
5 changes: 2 additions & 3 deletions operations-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ kotlin {
}
}

val xcFramework = XCFramework(LibConfig.name)
val xcFramework = XCFramework(Modules.XCFrameworkNames.operationsApi)
listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
).forEach {
it.binaries.framework {
baseName = LibConfig.name
baseName = Modules.XCFrameworkNames.operationsApi
isStatic = true
xcFramework.add(this)
}
Expand All @@ -41,4 +41,3 @@ kotlin {
}
}
}
apply(plugin = Conventions.xcframeworkAssemble)
5 changes: 2 additions & 3 deletions operations-stdlib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ kotlin {
}
}

val xcFramework = XCFramework(LibConfig.name)
val xcFramework = XCFramework(Modules.XCFrameworkNames.operationsStdlib)
listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
).forEach {
it.binaries.framework {
baseName = LibConfig.name
baseName = Modules.XCFrameworkNames.operationsStdlib
isStatic = true
xcFramework.add(this)
}
Expand All @@ -47,4 +47,3 @@ kotlin {
}
}
}
apply(plugin = Conventions.xcframeworkAssemble)
26 changes: 4 additions & 22 deletions utils/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import org.jetbrains.kotlin.gradle.plugin.mpp.apple.XCFramework

plugins {
kotlin("multiplatform") version Versions.kotlin
id("io.kotest.multiplatform") version Versions.kotest apply false
Expand All @@ -12,18 +10,10 @@ kotlin {
}
}

val xcFramework = XCFramework(LibConfig.name)
listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
).forEach {
it.binaries.framework {
baseName = LibConfig.name
isStatic = true
xcFramework.add(this)
}
}
iosX64()
iosArm64()
iosSimulatorArm64()

sourceSets {
val commonMain by getting
val commonTest by getting
Expand All @@ -39,11 +29,3 @@ kotlin {
}
}
}

/*
We need to disable this task, because it fails with following error:
`the path does not point to a valid debug symbols file`.
Currently we are using only Release XCFramework.
It could be fixed also by `isStatic = false` but we want to get static lib.
*/
tasks.getByName("assembleJsonLogicKMPDebugXCFramework").enabled = false

0 comments on commit 7f80a42

Please sign in to comment.