From f43fb55cecefcd469d7624f3659121aa9d4e590f Mon Sep 17 00:00:00 2001 From: Jack Boswell Date: Sun, 17 Sep 2023 15:12:34 +1200 Subject: [PATCH] Fix publish workflow (#2) * Fix publish workflow * Update publish.yml * Try to fix publications * Try to fix publications --- .github/workflows/publish.yml | 6 +++++- core/build.gradle.kts | 17 +++++------------ material3/build.gradle.kts | 20 ++++++-------------- 3 files changed, 16 insertions(+), 27 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 45733d2..638a877 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,6 +6,9 @@ on: jobs: publish: runs-on: ubuntu-latest + permissions: + contents: read + packages: write steps: - name: Checkout uses: actions/checkout@v3 @@ -19,7 +22,8 @@ jobs: - name: Build run: ./gradlew publish --scan env: + PUBLISHING: true ORG_GRADLE_PROJECT_githubUsername: boswelja - ORG_GRADLE_PROJECT_githubToken: ${{ GITHUB_TOKEN }} + ORG_GRADLE_PROJECT_githubToken: ${{ secrets.GITHUB_TOKEN }} ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.OSSRH_USERNAME }} ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.OSSRH_PASSWORD }} diff --git a/core/build.gradle.kts b/core/build.gradle.kts index cb9e571..7ad9127 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -7,6 +7,8 @@ plugins { id("maven-publish") } +group = "io.github.boswelja.menuprovider" +version = "1.0" android { namespace = "com.boswelja.menuprovider" @@ -38,7 +40,9 @@ kotlin { jvmToolchain(17) explicitApi() - androidTarget() + androidTarget { + publishLibraryVariants("release") + } sourceSets { commonMain { @@ -58,17 +62,6 @@ detekt { } publishing { - publications { - register("release") { - groupId = "io.github.boswelja.menuprovider" - artifactId = "core" - version = "1.0" - - afterEvaluate { - from(components["release"]) - } - } - } repositories { if (System.getenv("PUBLISHING") == "true") { maven("https://maven.pkg.github.com/boswelja/Compose-MenuProvider") { diff --git a/material3/build.gradle.kts b/material3/build.gradle.kts index e620567..057bf73 100644 --- a/material3/build.gradle.kts +++ b/material3/build.gradle.kts @@ -1,5 +1,3 @@ -import org.jetbrains.kotlin.gradle.plugin.extraProperties - plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.multiplatform) @@ -10,6 +8,9 @@ plugins { id("maven-publish") } +group = "io.github.boswelja.menuprovider" +version = "1.0" + android { namespace = "com.boswelja.menuprovider.material3" @@ -40,7 +41,9 @@ kotlin { jvmToolchain(17) explicitApi() - androidTarget() + androidTarget { + publishLibraryVariants("release") + } sourceSets { commonMain { @@ -59,17 +62,6 @@ detekt { } publishing { - publications { - register("release") { - groupId = "io.github.boswelja.menuprovider" - artifactId = "material3" - version = "1.0" - - afterEvaluate { - from(components["release"]) - } - } - } repositories { if (System.getenv("PUBLISHING") == "true") { maven("https://maven.pkg.github.com/boswelja/Compose-MenuProvider") {