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
20 changes: 15 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,25 @@ jobs:
with:
distribution: 'zulu'
java-version: '17'
cache: 'gradle'

- name: Grant execute permission for Gradlew
run: chmod +x gradlew

- name: Upload Artifacts to Maven Central
run: ./gradlew publishToMavenCentral --no-daemon --no-parallel
run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-daemon --no-parallel
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}

- name: Retrieve Version
run: |
echo "VERSION_NAME=$(cat gradle.properties | grep -w "VERSION_NAME" | cut -d'=' -f2)" >> $GITHUB_ENV

- name: Publish Release
run: ./gradlew closeAndReleaseRepository --no-daemon --no-parallel
if: "!endsWith(env.VERSION_NAME, '-SNAPSHOT')"
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
7 changes: 7 additions & 0 deletions .github/workflows/create_swift_package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: Create Swift Package

on:
workflow_dispatch:
jobs:
publish:
uses: touchlab/KMMBridgeGithubWorkflow/.github/workflows/[email protected]
27 changes: 16 additions & 11 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,27 @@ Releasing
========

1. Change the version in top level `gradle.properties` to a non-SNAPSHOT version.
2. Update the `CHANGELOG.md` for the impending release.
3. Update the `README.md` with the new version.
4. `git commit -sam "Prepare for release X.Y.Z."` (where X.Y.Z is the new version)
5. `git tag -a X.Y.X -m "Version X.Y.Z"` (where X.Y.Z is the new version)
2. Update the `cocoapods` version in `build.gradle.kts` in `:store`.
3. Modify `create_swift_package.yml` workflow.
* https://github.com/MobileNativeFoundation/Store/blob/e526400cdf51aa2f78b6b7e9e87f4a6845e6dcea/.github/workflows/create_swift_package.yml
4. Update the `CHANGELOG.md` for the impending release.
5. Update the `README.md` with the new version.
6. `git commit -sam "Prepare for release X.Y.Z."` (where X.Y.Z is the new version)
7. `git tag -a X.Y.X -m "Version X.Y.Z"` (where X.Y.Z is the new version)
* Run `git tag` to verify it.
6. `git push && git push --tags`
8. `git push && git push --tags`
* This should be pushed to your fork.
7. Create a PR with this commit and merge it.
8. Update the top level `build.gradle` to the next SNAPSHOT version.
9. `git commit -am "Prepare next development version."`
10. Create a PR with this commit and merge it.
11. Login to Sonatype to promote the artifacts https://central.sonatype.org/pages/releasing-the-deployment.html
9. Create a PR with this commit and merge it.
10. Update the top level `build.gradle` to the next SNAPSHOT version.
11. Modify `create_swift_package.yml` workflow to only run manually.
* https://github.com/MobileNativeFoundation/Store/blob/de9ed1764408eeaafe5e58fe602205c875a8b0b0/.github/workflows/create_swift_package.yml
12. `git commit -am "Prepare next development version."`
13. Create a PR with this commit and merge it.
14. Login to Sonatype to promote the artifacts https://central.sonatype.org/pages/releasing-the-deployment.html
* This part is automated. If it fails in CI, follow the steps below.
* Click on Staging Repositories under Build Promotion
* Select all the Repositories that contain the content you want to release
* Click on Close and refresh until the Release button is active
* Click Release and submit
12. Update the sample module's `build.gradle` to point to the newly released version. (It may take ~2 hours for artifact to be available after release)
15. Update the sample module's `build.gradle` to point to the newly released version. (It may take ~2 hours for artifact to be available after release)

7 changes: 4 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ buildscript {
classpath(libs.jacoco.gradle.plugin)
classpath(libs.maven.publish.plugin)
classpath(libs.atomic.fu.gradle.plugin)
classpath(libs.kmmBridge.gradle.plugin)
classpath(libs.binary.compatibility.validator)
}
}
Expand Down Expand Up @@ -48,13 +49,13 @@ subprojects {
tasks {
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
jvmTarget = "17"
jvmTarget = "11"
}
}

withType<JavaCompile>().configureEach {
sourceCompatibility = JavaVersion.VERSION_17.name
targetCompatibility = JavaVersion.VERSION_17.name
sourceCompatibility = JavaVersion.VERSION_11.name
targetCompatibility = JavaVersion.VERSION_11.name
}
}

Expand Down
12 changes: 9 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,30 +1,35 @@
[versions]
androidMinSdk = "24"
androidCompileSdk = "33"
androidGradlePlugin = "8.0.2"
androidGradlePlugin = "8.0.0"
androidTargetSdk = "33"
atomicFu = "0.24.0"
baseKotlin = "2.1.21"
baseKotlin = "2.0.20"
dokkaGradlePlugin = "1.9.20"
ktlintGradle = "12.1.0"
jacocoGradlePlugin = "0.8.12"
mavenPublishPlugin = "0.34.0"
moleculeGradlePlugin = "1.2.1"
pagingCompose = "3.3.0-alpha02"
pagingRuntime = "3.2.1"
spotlessPluginGradle = "6.4.1"
junit = "4.13.2"
kotlinxCoroutines = "1.8.1"
kotlinxSerialization = "1.6.3"
kermit = "2.0.5"
testCore = "1.6.1"
kmmBridge = "0.3.2"
ktlint = "0.39.0"
kover = "0.9.0-RC"
store = "5.1.0-alpha07"
truth = "1.1.3"
turbine = "1.2.0"
binary-compatibility-validator = "0.16.3"
binary-compatibility-validator = "0.15.0-Beta.2"

[libraries]
android-gradle-plugin = { group = "com.android.tools.build", name = "gradle", version.ref = "androidGradlePlugin" }
androidx-paging-compose = { module = "androidx.paging:paging-compose", version.ref = "pagingCompose" }
androidx-paging-runtime = { module = "androidx.paging:paging-runtime", version.ref = "pagingRuntime" }
kotlin-gradle-plugin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "baseKotlin" }
kotlin-serialization-plugin = { group = "org.jetbrains.kotlin", name = "kotlin-serialization", version.ref = "baseKotlin" }
dokka-gradle-plugin = { group = "org.jetbrains.dokka", name = "dokka-gradle-plugin", version.ref = "dokkaGradlePlugin" }
Expand All @@ -34,6 +39,7 @@ maven-publish-plugin = { group = "com.vanniktech", name = "gradle-maven-publish-
kover-gradle-plugin = {group = "org.jetbrains.kotlinx", name = "kover-gradle-plugin", version.ref = "kover"}

atomic-fu-gradle-plugin = { group = "org.jetbrains.kotlinx", name = "atomicfu-gradle-plugin", version.ref = "atomicFu" }
kmmBridge-gradle-plugin = { group = "co.touchlab.faktory.kmmbridge", name = "co.touchlab.faktory.kmmbridge.gradle.plugin", version.ref = "kmmBridge" }

kotlinx-atomic-fu = { group = "org.jetbrains.kotlinx", name = "atomicfu", version.ref = "atomicFu" }
kotlin-stdlib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib", version.ref = "baseKotlin" }
Expand Down
7 changes: 4 additions & 3 deletions tooling/plugins/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ plugins {
group = "org.mobilenativefoundation.store"

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11

toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
languageVersion.set(JavaLanguageVersion.of(11))
}
}

Expand All @@ -18,6 +18,7 @@ dependencies {
compileOnly(libs.kotlin.gradle.plugin)
compileOnly(libs.dokka.gradle.plugin)
compileOnly(libs.maven.publish.plugin)
compileOnly(libs.kmmBridge.gradle.plugin)
compileOnly(libs.atomic.fu.gradle.plugin)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ class AndroidConventionPlugin : Plugin<Project> {
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@

package org.mobilenativefoundation.store.tooling.plugins

import addGithubPackagesRepository
import co.touchlab.faktory.KmmBridgeExtension
import com.android.build.api.dsl.LibraryExtension
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import kotlinx.atomicfu.plugin.gradle.AtomicFUPluginExtension
import org.gradle.api.JavaVersion
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.plugins.ExtensionAware
import org.gradle.api.plugins.JavaPluginExtension
import org.gradle.jvm.toolchain.JavaLanguageVersion
import org.gradle.kotlin.dsl.configure
Expand All @@ -16,6 +19,7 @@ import org.gradle.kotlin.dsl.withType
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
import org.jetbrains.kotlin.gradle.plugin.cocoapods.CocoapodsExtension
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget

class KotlinMultiplatformConventionPlugin : Plugin<Project> {
Expand All @@ -28,17 +32,20 @@ class KotlinMultiplatformConventionPlugin : Plugin<Project> {
apply("com.android.library")
apply("com.vanniktech.maven.publish")
apply("org.jetbrains.dokka")
apply("co.touchlab.faktory.kmmbridge")
apply("maven-publish")
apply("org.jetbrains.kotlin.native.cocoapods")
apply("kotlinx-atomicfu")
apply("org.jetbrains.kotlinx.binary-compatibility-validator")
}


extensions.configure<KotlinMultiplatformExtension> {

androidTarget()
applyDefaultHierarchyTemplate()

androidTarget()

jvm()

iosX64()
Expand All @@ -57,7 +64,7 @@ class KotlinMultiplatformConventionPlugin : Plugin<Project> {
nodejs()
}

jvmToolchain(17)
jvmToolchain(11)

targets.all {
compilations.all {
Expand Down Expand Up @@ -110,13 +117,15 @@ class KotlinMultiplatformConventionPlugin : Plugin<Project> {
dependsOn(sourceSets.getByName("commonMain"))
}


configureCocoapods()
}

configureKotlin()
configureAndroid()
configureDokka()
configureMavenPublishing()
addGithubPackagesRepository()
configureKmmBridge()
configureAtomicFu()
}
}
Expand All @@ -129,14 +138,13 @@ fun Project.configureKotlin() {
fun Project.configureJava() {
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
languageVersion.set(JavaLanguageVersion.of(11))
}
}
}

fun Project.configureAndroid() {
android {
namespace = "org.mobilenativefoundation.store.$name"
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
compileSdk = Versions.COMPILE_SDK
defaultConfig {
Expand All @@ -151,8 +159,8 @@ fun Project.configureAndroid() {
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}
}
Expand All @@ -172,11 +180,18 @@ object Versions {


fun Project.configureMavenPublishing() = extensions.configure<MavenPublishBaseExtension> {
publishToMavenCentral(automaticRelease = true)
publishToMavenCentral()
signAllPublications()
}


fun Project.configureKmmBridge() = extensions.configure<KmmBridgeExtension> {
githubReleaseArtifacts()
githubReleaseVersions()
versionPrefix.set(Versions.STORE)
spm()
}

fun Project.configureAtomicFu() =
extensions.configure<AtomicFUPluginExtension> {
transformJvm = false
Expand All @@ -187,6 +202,18 @@ fun Project.configureDokka() = tasks.withType<DokkaTask>().configureEach {
dokkaSourceSets.configureEach {
reportUndocumented.set(false)
skipDeprecated.set(true)
jdkVersion.set(17)
jdkVersion.set(11)
}
}

fun Project.android(name: String) {
android {
namespace = "org.mobilenativefoundation.store.$name"
}
}

fun KotlinMultiplatformExtension.configureCocoapods(){
(this as ExtensionAware).extensions.configure(CocoapodsExtension::class.java) {
version = Versions.STORE
}
}
Loading