diff --git a/.github/workflows/publish-kmp.yaml b/.github/workflows/publish-kmp.yaml new file mode 100644 index 000000000..1cbf46e30 --- /dev/null +++ b/.github/workflows/publish-kmp.yaml @@ -0,0 +1,25 @@ +name: Publish KMP Library + +on: + pull_request: + types: [closed] + branches: [master] + paths: + - 'mobile/kmp/**' + +permissions: + contents: read + packages: write + +jobs: + publish: + if: github.event.pull_request.merged == true + runs-on: macos-15 + steps: + - uses: atls/shared/.github/actions/publish/kmp@master + with: + workingDirectory: mobile/kmp + githubToken: ${{ secrets.GITHUB_TOKEN }} + gradleArguments: > + :storybook:publishAllPublicationsToGitHubPackagesRepository + :ui:publishAllPublicationsToGitHubPackagesRepository diff --git a/mobile/kmp/.gitignore b/mobile/kmp/.gitignore index 199ca3c8b..a8551f1c6 100644 --- a/mobile/kmp/.gitignore +++ b/mobile/kmp/.gitignore @@ -8,3 +8,4 @@ iosApp/Pods iosApp/GoogleService-Info.plist xcuserdata/ *.xcuserstate +**/*.xcodeproj/xcuserdata/ diff --git a/mobile/kmp/iosApp/iosApp.xcodeproj/xcuserdata/comfrt1k.xcuserdatad/xcschemes/iosApp.xcscheme b/mobile/kmp/iosApp/iosApp.xcodeproj/xcuserdata/comfrt1k.xcuserdatad/xcschemes/iosApp.xcscheme deleted file mode 100644 index f597e5fc8..000000000 --- a/mobile/kmp/iosApp/iosApp.xcodeproj/xcuserdata/comfrt1k.xcuserdatad/xcschemes/iosApp.xcscheme +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mobile/kmp/storybook/build.gradle.kts b/mobile/kmp/storybook/build.gradle.kts index f77186dec..2bd59b5dc 100644 --- a/mobile/kmp/storybook/build.gradle.kts +++ b/mobile/kmp/storybook/build.gradle.kts @@ -5,18 +5,26 @@ plugins { alias(libs.plugins.androidLibrary) alias(libs.plugins.composeMultiplatform) alias(libs.plugins.composeCompiler) + `maven-publish` + base } group = "com.atls.hyperion" -version = "0.1.0" +version = "0.1.1" +description = "KMP Storybook" + +base { + archivesName.set("storybook") +} kotlin { androidTarget { + publishLibraryVariants("release") compilerOptions { jvmTarget.set(JvmTarget.JVM_21) } } - + listOf( iosX64(), iosArm64(), @@ -27,7 +35,7 @@ kotlin { isStatic = true } } - + sourceSets { commonMain.dependencies { implementation(compose.runtime) @@ -62,4 +70,12 @@ android { sourceCompatibility = JavaVersion.toVersion(javaTargetValue) targetCompatibility = JavaVersion.toVersion(javaTargetValue) } + + publishing { + singleVariant("release") { + withSourcesJar() + } + } } + +apply(from = "../ui/publishing.gradle.kts") diff --git a/mobile/kmp/ui/build.gradle.kts b/mobile/kmp/ui/build.gradle.kts index 1b9cbf43f..cc39e260d 100644 --- a/mobile/kmp/ui/build.gradle.kts +++ b/mobile/kmp/ui/build.gradle.kts @@ -5,13 +5,22 @@ plugins { alias(libs.plugins.androidLibrary) alias(libs.plugins.composeMultiplatform) alias(libs.plugins.composeCompiler) + `maven-publish` + base } group = "com.atls.hyperion" -version = "0.4.0" +version = "0.4.1" +description = "Highly ordered User Interface Kit" + +base { + archivesName.set("hyperion") +} kotlin { androidTarget { + publishLibraryVariants("release") + compilerOptions { jvmTarget.set(JvmTarget.JVM_21) } @@ -30,7 +39,7 @@ kotlin { sourceSets { commonMain.dependencies { - api(project(":storybook")) + implementation(project(":storybook")) implementation(compose.runtime) implementation(compose.foundation) implementation(compose.material) @@ -82,4 +91,11 @@ android { sourceCompatibility = JavaVersion.toVersion(javaTargetValue) targetCompatibility = JavaVersion.toVersion(javaTargetValue) } + publishing { + singleVariant("release") { + withSourcesJar() + } + } } + +apply(from = "publishing.gradle.kts") diff --git a/mobile/kmp/ui/publishing.gradle.kts b/mobile/kmp/ui/publishing.gradle.kts new file mode 100644 index 000000000..d832e0bb7 --- /dev/null +++ b/mobile/kmp/ui/publishing.gradle.kts @@ -0,0 +1,48 @@ +import org.gradle.api.publish.PublishingExtension +import org.gradle.api.publish.maven.MavenPublication +import java.net.URI + +configure { + publications.withType().configureEach { + groupId = project.group.toString() + version = project.version.toString() + + pom { + name.set(project.name) + description.set(project.description ?: "") + url.set("https://github.com/atls/hyperion") + + licenses { + license { + name.set("The Apache License, Version 2.0") + url.set("https://www.apache.org/licenses/LICENSE-2.0.txt") + } + } + + developers { + developer { + id.set("atls") + name.set("Atlantis Team") + email.set("me@atls.team") + } + } + + scm { + connection.set("scm:git:git://github.com/atls/hyperion.git") + developerConnection.set("scm:git:ssh://github.com:atls/hyperion.git") + url.set("https://github.com/atls/hyperion/tree/master/mobile/kmp") + } + } + } + + repositories { + maven { + name = "GitHubPackages" + url = URI.create("https://maven.pkg.github.com/atls/hyperion") + credentials { + username = System.getenv("GITHUB_ACTOR") ?: project.findProperty("gpr.user") as String? + password = System.getenv("GITHUB_TOKEN") ?: project.findProperty("gpr.key") as String? + } + } + } +} diff --git a/mobile/kmp/ui/src/commonMain/kotlin/com/atls/hyperion/ui/components/button/Layout.kt b/mobile/kmp/ui/src/commonMain/kotlin/com/atls/hyperion/ui/components/button/Layout.kt index 3077aaab7..41fa737b8 100644 --- a/mobile/kmp/ui/src/commonMain/kotlin/com/atls/hyperion/ui/components/button/Layout.kt +++ b/mobile/kmp/ui/src/commonMain/kotlin/com/atls/hyperion/ui/components/button/Layout.kt @@ -106,3 +106,4 @@ fun ButtonLayout( } } } + diff --git a/mobile/kmp/ui/src/commonMain/kotlin/com/atls/hyperion/ui/theme/typography/NunitoSansFontFamily.kt b/mobile/kmp/ui/src/commonMain/kotlin/com/atls/hyperion/ui/theme/typography/NunitoSansFontFamily.kt index f05979883..7c9dd7cb4 100644 --- a/mobile/kmp/ui/src/commonMain/kotlin/com/atls/hyperion/ui/theme/typography/NunitoSansFontFamily.kt +++ b/mobile/kmp/ui/src/commonMain/kotlin/com/atls/hyperion/ui/theme/typography/NunitoSansFontFamily.kt @@ -7,8 +7,8 @@ import com.atls.hyperion.ui.generated.resources.NunitoSans_300 import com.atls.hyperion.ui.generated.resources.NunitoSans_400 import com.atls.hyperion.ui.generated.resources.NunitoSans_500 import com.atls.hyperion.ui.generated.resources.NunitoSans_600 -import org.jetbrains.compose.resources.Font import com.atls.hyperion.ui.generated.resources.Res +import org.jetbrains.compose.resources.Font @Composable fun NunitoSansFontFamily() = FontFamily(