Skip to content

Commit

Permalink
Add to publish module gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
taewooyo committed Nov 3, 2023
1 parent c9ccd44 commit 6464db0
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 2 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish

on:
release:
types: [ released ]
workflow_dispatch:

jobs:
publish:
name: Snapshot build and publish
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/[email protected]

- name: Set up JDK 17
uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: 17

- name: Grant Permission to Execute Gradle
run: chmod +x gradlew

- name: Release build
run: ./gradlew assemble --scan

- name: Publish to MavenCentral
run: |
./gradlew publishAllPublicationsToMavenCentral --no-configuration-cache
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
6 changes: 4 additions & 2 deletions scripts/publish-module.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
apply(plugin = "com.vannikteh.maven.publish")
import com.taewooyo.buildsrc.Configuration

apply(plugin = "com.vanniktech.maven.publish")

rootProject.extra.apply {
val snapshot = System.getenv("SNAPSHOT").toBoolean()
val libVersion = if(snapshot) {
Configuration.snapshotVeresionName
Configuration.snapshotVersionName
} else {
Configuration.versionName
}
Expand Down
16 changes: 16 additions & 0 deletions volcano-compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,22 @@ plugins {
alias(libs.plugins.nexus.plugin)
}

apply(from = "${rootDir}/scripts/publish-module.gradle.kts")

mavenPublishing {
val artifactId = "volcano-compose"
coordinates(
Configuration.artifactGroup,
artifactId,
rootProject.extra.get("libVersion").toString()
)

pom {
name.set(artifactId)
description.set("Heatmap charts created in an optimized way, fully customizable for Android. Support only Jetpack Compose.")
}
}

android {
compileSdk = Configuration.compileSdk
namespace = "com.taewooyo.volcano.compose"
Expand Down
18 changes: 18 additions & 0 deletions volcano/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
import com.taewooyo.buildsrc.Configuration

@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
plugins {
id("java-library")
id("kotlin")
alias(libs.plugins.nexus.plugin)
}

apply(from = "${rootDir}/scripts/publish-module.gradle.kts")

mavenPublishing {
val artifactId = "volcano"
coordinates(
Configuration.artifactGroup,
artifactId,
rootProject.extra.get("libVersion").toString()
)

pom {
name.set(artifactId)
description.set("Heatmap charts created in an optimized way, fully customizable for Android. Support only Jetpack Compose.")
}
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
Expand Down

0 comments on commit 6464db0

Please sign in to comment.