From 6582e45ac0c83278ec8d5d7a568382d8b9c28526 Mon Sep 17 00:00:00 2001 From: Xavier Molloy Date: Wed, 3 Jul 2024 14:32:37 +0200 Subject: [PATCH 1/2] ci: fix maven publish --- build.gradle.kts | 11 ++++++++++- designsystem/build.gradle.kts | 11 ++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 6bd16985c..174b6987e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,6 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask import org.jetbrains.kotlin.gradle.tasks.KotlinCompile - +version = "0.2-SNAPSHOT" group = "org.hisp.dhis.mobile" plugins { @@ -13,6 +13,15 @@ plugins { id("io.github.gradle-nexus.publish-plugin") version "1.3.0" } +/** + * Property from the Gradle command line. To remove the snapshot suffix from the version. + */ +if (project.hasProperty("removeSnapshotSuffix")) { + val mainVersion = (version as String).split("-SNAPSHOT")[0] + version = mainVersion +} + + allprojects { apply(plugin = "org.jlleitschuh.gradle.ktlint") ktlint { diff --git a/designsystem/build.gradle.kts b/designsystem/build.gradle.kts index 43d36ceac..0b28ada97 100644 --- a/designsystem/build.gradle.kts +++ b/designsystem/build.gradle.kts @@ -1,5 +1,5 @@ -version = "0.2-SNAPSHOT" -group = "org.hisp.dhis.mobile" +version = rootProject.version +group = rootProject.group plugins { kotlin("multiplatform") @@ -9,13 +9,6 @@ plugins { id("app.cash.paparazzi").version("1.3.3") } -/** - * Property from the Gradle command line. To remove the snapshot suffix from the version. - */ -if (project.hasProperty("removeSnapshotSuffix")) { - val mainVersion = (version as String).split("-SNAPSHOT")[0] - version = mainVersion -} kotlin { androidTarget { From fdbc869455aa0a72de1370cc93eb209888219b66 Mon Sep 17 00:00:00 2001 From: Xavier Molloy Date: Wed, 3 Jul 2024 14:45:13 +0200 Subject: [PATCH 2/2] ci: revert osshr username and password, ktlint, and modify osshr username and password correctly --- .github/workflows/continuous-deployment.yml | 4 ++-- build.gradle.kts | 5 ++--- designsystem/build.gradle.kts | 1 - 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/continuous-deployment.yml b/.github/workflows/continuous-deployment.yml index 958482e7f..3438728e4 100644 --- a/.github/workflows/continuous-deployment.yml +++ b/.github/workflows/continuous-deployment.yml @@ -37,7 +37,7 @@ jobs: - name: Publish to maven run: ./.github/workflows/scripts/publish-maven.sh env: - OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} - OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} + OSSRH_USERNAME: ${{ secrets.SONATYPE_OSSRH_USERNAME }} + OSSRH_PASSWORD: ${{ secrets.SONATYPE_OSSRH_PASSWORD }} SIGNING_PRIVATE_KEY: ${{ secrets.PGP_PRIVATE_KEY }} SIGNING_PASSWORD: ${{ secrets.PGP_PASSPHRASE }} diff --git a/build.gradle.kts b/build.gradle.kts index 174b6987e..9db369b56 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -21,7 +21,6 @@ if (project.hasProperty("removeSnapshotSuffix")) { version = mainVersion } - allprojects { apply(plugin = "org.jlleitschuh.gradle.ktlint") ktlint { @@ -80,8 +79,8 @@ subprojects { } } -val ossrhUsername: String? = System.getenv("SONATYPE_OSSRH_USERNAME") -val ossrhPassword: String? = System.getenv("SONATYPE_OSSRH_PASSWORD") +val ossrhUsername: String? = System.getenv("OSSRH_USERNAME") +val ossrhPassword: String? = System.getenv("OSSRH_PASSWORD") nexusPublishing { this.repositories { diff --git a/designsystem/build.gradle.kts b/designsystem/build.gradle.kts index 0b28ada97..2ae311c0a 100644 --- a/designsystem/build.gradle.kts +++ b/designsystem/build.gradle.kts @@ -9,7 +9,6 @@ plugins { id("app.cash.paparazzi").version("1.3.3") } - kotlin { androidTarget { publishLibraryVariants("release")