Skip to content

Commit

Permalink
Fix publish workflow (#2)
Browse files Browse the repository at this point in the history
* Fix publish workflow

* Update publish.yml

* Try to fix publications

* Try to fix publications
  • Loading branch information
boswelja authored Sep 17, 2023
1 parent 7ba69b3 commit f43fb55
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 27 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -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 }}
17 changes: 5 additions & 12 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ plugins {

id("maven-publish")
}
group = "io.github.boswelja.menuprovider"
version = "1.0"

android {
namespace = "com.boswelja.menuprovider"
Expand Down Expand Up @@ -38,7 +40,9 @@ kotlin {
jvmToolchain(17)
explicitApi()

androidTarget()
androidTarget {
publishLibraryVariants("release")
}

sourceSets {
commonMain {
Expand All @@ -58,17 +62,6 @@ detekt {
}

publishing {
publications {
register<MavenPublication>("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") {
Expand Down
20 changes: 6 additions & 14 deletions material3/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import org.jetbrains.kotlin.gradle.plugin.extraProperties

plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.multiplatform)
Expand All @@ -10,6 +8,9 @@ plugins {
id("maven-publish")
}

group = "io.github.boswelja.menuprovider"
version = "1.0"

android {
namespace = "com.boswelja.menuprovider.material3"

Expand Down Expand Up @@ -40,7 +41,9 @@ kotlin {
jvmToolchain(17)
explicitApi()

androidTarget()
androidTarget {
publishLibraryVariants("release")
}

sourceSets {
commonMain {
Expand All @@ -59,17 +62,6 @@ detekt {
}

publishing {
publications {
register<MavenPublication>("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") {
Expand Down

0 comments on commit f43fb55

Please sign in to comment.