Skip to content

Commit

Permalink
Trying to publish artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
vooft committed Dec 1, 2024
1 parent fea1869 commit ab67215
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up JDK 21
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: 21
java-version: 11
distribution: temurin
cache: gradle

Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish

on:
release:
types: [published]

jobs:
publish:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Publish
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYPASSWORD }}
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
TAG: ${{ github.event.release.tag_name }}
run: ./gradlew composeTreeviewPublishToMavenCentral --no-daemon
17 changes: 17 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,20 @@ allprojects {
mavenCentral()
}
}

tasks.register("composeTreeviewPublishToMavenCentral") {
dependsOn(
// subprojects.mapNotNull { it.tasks.findByName("publishAndReleaseToMavenCentral") } +
// gradle.includedBuilds.map { it.task(":publishAndReleaseToMavenCentral") }

subprojects.mapNotNull { it.tasks.findByName("publishAndToMavenCentral") } +
gradle.includedBuilds.map { it.task(":publishAndToMavenCentral") }
)
}

tasks.register("composeTreeviewPublishToMavenLocal") {
dependsOn(
subprojects.mapNotNull { it.tasks.findByName("publishToMavenLocal") } +
gradle.includedBuilds.map { it.task(":publishToMavenLocal") }
)
}
33 changes: 33 additions & 0 deletions buildSrc/src/main/kotlin/compose-treeview-publish.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import com.vanniktech.maven.publish.SonatypeHost

plugins {
id("org.jetbrains.dokka")
id("com.vanniktech.maven.publish")
}

mavenPublishing {
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)

signAllPublications()

pom {
name = "compose-treeview"
description = "Compose Multiplatform TreeView implementation"
url = "https://github.com/vooft/compose-treeview"
licenses {
license {
name = "The MIT License"
url = "https://opensource.org/licenses/MIT"
}
}
scm {
connection = "https://github.com/vooft/compose-treeview"
url = "https://github.com/vooft/compose-treeview"
}
developers {
developer {
name = "compose-treeview team"
}
}
}
}
1 change: 1 addition & 0 deletions compose-treeview-core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
`compose-treeview-multiplatform-lib`
`compose-treeview-publish`
alias(libs.plugins.compose.multiplatform)
alias(libs.plugins.compose.compiler)
}
Expand Down
1 change: 1 addition & 0 deletions compose-treeview-json/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
`compose-treeview-multiplatform-lib`
`compose-treeview-publish`
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.compose.multiplatform)
alias(libs.plugins.compose.compiler)
Expand Down

0 comments on commit ab67215

Please sign in to comment.