Skip to content
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
19 changes: 18 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ concurrency:

jobs:
gradle_check:
name: Gradle check
name: Gradle check (JVM, Linux, JS)
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -27,3 +27,20 @@ jobs:

- name: Run checks
run: ./gradlew -Dorg.gradle.jvmargs=-Xmx4096m check

macos_check:
name: Gradle check (iOS)
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Set up JDK 21
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 21
cache: 'gradle'

- name: Run checks
run: ./gradlew -Dorg.gradle.jvmargs=-Xmx4096m check
22 changes: 21 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
maven_publish:
name: Release build and publish
runs-on: ubuntu-latest
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v6
Expand All @@ -35,6 +35,15 @@ jobs:
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY_CONTENTS }}

- name: Build iOS XCFramework
run: ./gradlew -Dorg.gradle.jvmargs=-Xmx4096m -Pversion=${{ env.VERSION }} --no-configuration-cache :jecnaapi-ios:podPublishReleaseXCFramework

- name: Upload iOS XCFramework
uses: actions/upload-artifact@v4
with:
name: JecnaapiIOS-xcframework
path: jecnaapi-ios/build/cocoapods/xcframework/release/JecnaapiIOS.xcframework

gh_release:
name: Create GitHub Release
needs: maven_publish
Expand All @@ -44,13 +53,24 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Download iOS XCFramework
uses: actions/download-artifact@v4
with:
name: JecnaapiIOS-xcframework
path: JecnaapiIOS.xcframework

- name: Create XCFramework zip
run: zip -r JecnaapiIOS-${{ github.ref_name }}-xcframework.zip JecnaapiIOS.xcframework/

- name: Create Release
uses: softprops/action-gh-release@v2
with:
# github.ref_name is the tag (e.g., 'v1.0.0')
name: ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
generate_release_notes: true
files: JecnaapiIOS-${{ github.ref_name }}-xcframework.zip

update_readme:
name: Update project version in README
Expand Down
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ ktor-client-encoding = { module = "io.ktor:ktor-client-encoding", version.ref =
ktor-client-engine-java = { module = "io.ktor:ktor-client-java", version.ref = "ktor" }
ktor-client-engine-curl = { module = "io.ktor:ktor-client-curl", version.ref = "ktor" }
ktor-client-engine-js = { module = "io.ktor:ktor-client-js", version.ref = "ktor" }
ktor-client-engine-darwin = { module = "io.ktor:ktor-client-darwin", version.ref = "ktor" }
ktor-client-engine-android = { module = "io.ktor:ktor-client-android", version.ref = "ktor" }

[plugins]
Expand Down
11 changes: 10 additions & 1 deletion jecnaapi-canteen/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ plugins {
kotlin {
jvm()
linuxX64()
iosX64()
iosArm64()
iosSimulatorArm64()
js {
browser {
testTask { enabled = false }
Expand All @@ -21,6 +24,7 @@ kotlin {
testTask { enabled = false }
}
}
applyDefaultHierarchyTemplate()
androidLibrary {
namespace = "io.github.tomhula.jecnaapi.canteen"
compileSdk = 36
Expand All @@ -35,9 +39,14 @@ kotlin {
jvmMain.dependencies {
runtimeOnly(libs.ktor.client.engine.java)
}
nativeMain.dependencies {
val linuxX64Main by getting
linuxX64Main.dependencies {
runtimeOnly(libs.ktor.client.engine.curl)
}
val iosMain by getting
iosMain.dependencies {
runtimeOnly(libs.ktor.client.engine.darwin)
}
jsMain.dependencies {
runtimeOnly(libs.ktor.client.engine.js)
}
Expand Down
12 changes: 10 additions & 2 deletions jecnaapi-core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@file:OptIn(ExperimentalWasmDsl::class)

import org.gradle.internal.execution.caching.CachingState.enabled
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl

plugins {
Expand All @@ -13,6 +12,9 @@ plugins {
kotlin {
jvm()
linuxX64()
iosX64()
iosArm64()
iosSimulatorArm64()
js {
browser {
testTask { enabled = false }
Expand All @@ -23,6 +25,7 @@ kotlin {
testTask { enabled = false }
}
}
applyDefaultHierarchyTemplate()
androidLibrary {
namespace = "io.github.tomhula.jecnaapi.core"
compileSdk = 36
Expand All @@ -38,9 +41,14 @@ kotlin {
jvmMain.dependencies {
runtimeOnly(libs.ktor.client.engine.java)
}
nativeMain.dependencies {
val linuxX64Main by getting
linuxX64Main.dependencies {
runtimeOnly(libs.ktor.client.engine.curl)
}
val iosMain by getting
iosMain.dependencies {
runtimeOnly(libs.ktor.client.engine.darwin)
}
jsMain.dependencies {
runtimeOnly(libs.ktor.client.engine.js)
}
Expand Down
33 changes: 33 additions & 0 deletions jecnaapi-ios/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
plugins {
kotlin("multiplatform")
kotlin("native.cocoapods")
}

kotlin {
iosX64()
iosArm64()
iosSimulatorArm64()

sourceSets {
commonMain.dependencies {
api(project(":jecnaapi-jecna"))
api(project(":jecnaapi-canteen"))
}
}

cocoapods {
name = "JecnaapiIOS"
version = project.version.toString()
summary = "JecnaAPI umbrella framework for iOS"
homepage = "https://github.com/tomhula/JecnaAPI"
license = "GNU GPLv3"
ios.deploymentTarget = "15.0"
framework {
baseName = "JecnaapiIOS"
isStatic = true
export(project(":jecnaapi-jecna"))
export(project(":jecnaapi-canteen"))
transitiveExport = true
}
}
}
12 changes: 10 additions & 2 deletions jecnaapi-jecna/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@file:OptIn(ExperimentalWasmDsl::class)

import org.gradle.internal.execution.caching.CachingState.enabled
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl

plugins {
Expand All @@ -13,6 +12,9 @@ plugins {
kotlin {
jvm()
linuxX64()
iosX64()
iosArm64()
iosSimulatorArm64()
js {
browser {
testTask { enabled = false }
Expand All @@ -23,6 +25,7 @@ kotlin {
testTask { enabled = false }
}
}
applyDefaultHierarchyTemplate()
androidLibrary {
namespace = "io.github.tomhula.jecnaapi.jecna"
compileSdk = 36
Expand All @@ -40,9 +43,14 @@ kotlin {
jvmMain.dependencies {
runtimeOnly(libs.ktor.client.engine.java)
}
nativeMain.dependencies {
val linuxX64Main by getting
linuxX64Main.dependencies {
runtimeOnly(libs.ktor.client.engine.curl)
}
val iosMain by getting
iosMain.dependencies {
runtimeOnly(libs.ktor.client.engine.darwin)
}
jsMain.dependencies {
runtimeOnly(libs.ktor.client.engine.js)
}
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
rootProject.name = "jecnaapi"
include("jecnaapi-core", "jecnaapi-jecna", "jecnaapi-canteen", "jecnaapi-jecna-java")
include("jecnaapi-core", "jecnaapi-jecna", "jecnaapi-canteen", "jecnaapi-jecna-java", "jecnaapi-ios")

pluginManagement {
repositories {
Expand Down