Skip to content

Commit a6f4d1e

Browse files
committed
Use nmcp plugin
1 parent 3895c00 commit a6f4d1e

File tree

4 files changed

+40
-50
lines changed

4 files changed

+40
-50
lines changed

.github/workflows/cli-release.yml

Lines changed: 11 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,8 @@ jobs:
4646
echo "IS_SNAPSHOT=$IS_SNAPSHOT" >> $GITHUB_ENV
4747
echo "PRE_RELEASE_FLAG=$PRE_RELEASE_FLAG" >> $GITHUB_ENV
4848
49-
# - name: Build CLI distribution
50-
# run: ./gradlew buildCLI
51-
52-
- name: Publish to Maven Central
53-
if: env.IS_SNAPSHOT == 'false'
54-
run: ./gradlew :tools:cli:publish
55-
env:
56-
OSSRH_USERNAME: ${{ secrets.ORG_MAVEN_CENTRAL_USERNAME }}
57-
OSSRH_PASSWORD: ${{ secrets.ORG_MAVEN_CENTRAL_PASSWORD }}
58-
PGP_KEY: ${{ secrets.PGP_KEY }}
59-
PGP_PASS: ${{ secrets.PGP_PAS }}
49+
- name: Build CLI distribution
50+
run: ./gradlew buildCLI
6051

6152
- name: Clean up existing release
6253
run: |
@@ -71,6 +62,15 @@ jobs:
7162
run: |
7263
gh release create ${{ env.RELEASE_TAG }} tools/cli/build/distributions/*.zip --generate-notes ${{ env.PRE_RELEASE_FLAG }}
7364
65+
- name: Publish to Maven Central
66+
if: env.IS_SNAPSHOT == 'false'
67+
run: ./gradlew publishAggregationToCentralPortal
68+
env:
69+
OSSRH_USERNAME: ${{ secrets.ORG_MAVEN_CENTRAL_USERNAME }}
70+
OSSRH_PASSWORD: ${{ secrets.ORG_MAVEN_CENTRAL_PASSWORD }}
71+
PGP_KEY: ${{ secrets.PGP_KEY }}
72+
PGP_PASS: ${{ secrets.PGP_PAS }}
73+
7474
- name: Update Homebrew formula
7575
uses: mislav/bump-homebrew-formula-action@v3
7676
if: env.IS_SNAPSHOT == 'false'
@@ -82,31 +82,3 @@ jobs:
8282
download-url: https://github.com/ComposeGears/Valkyrie/releases/download/${{ env.RELEASE_TAG }}/valkyrie-cli-${{ env.VERSION_NAME }}.zip
8383
commit-message: |
8484
Bump {{formulaName}} {{version}}
85-
86-
# - name: Clean up existing release
87-
# run: |
88-
# gh release view ${{ env.RELEASE_TAG }} && gh release delete ${{ env.RELEASE_TAG }} -y --cleanup-tag
89-
#
90-
# - name: Clean up previous snapshot release
91-
# if: env.IS_SNAPSHOT == 'false'
92-
# run: |
93-
# gh release view cli-${{ env.VERSION_NAME }}-SNAPSHOT && gh release delete cli-${{ env.VERSION_NAME }}-SNAPSHOT -y --cleanup-tag
94-
#
95-
# - name: Create GitHub release
96-
# run: |
97-
# gh release create ${{ env.RELEASE_TAG }} tools/cli/build/distributions/*.zip --generate-notes ${{ env.PRE_RELEASE_FLAG }}
98-
#
99-
# - name: Update Homebrew formula
100-
# uses: mislav/bump-homebrew-formula-action@v3
101-
# if: env.IS_SNAPSHOT == 'false'
102-
# with:
103-
# formula-name: valkyrie
104-
# formula-path: Formula/valkyrie.rb
105-
# tag-name: ${{ env.RELEASE_TAG }}
106-
# homebrew-tap: ComposeGears/homebrew-repo
107-
# download-url: https://github.com/ComposeGears/Valkyrie/releases/download/${{ env.RELEASE_TAG }}/valkyrie-cli-${{ env.VERSION_NAME }}.zip
108-
# commit-message: |
109-
# Bump {{formulaName}} {{version}}
110-
# env:
111-
# COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}
112-

build.gradle.kts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ plugins {
1818
alias(libs.plugins.buildconfig) apply false
1919
alias(libs.plugins.shadow) apply false
2020
alias(libs.plugins.spotless) apply false
21+
alias(libs.plugins.nmcp)
2122
}
2223

2324
allprojects {
@@ -87,3 +88,14 @@ allprojects {
8788
useJUnitPlatform()
8889
}
8990
}
91+
92+
nmcpAggregation {
93+
centralPortal {
94+
username = System.getenv("OSSRH_USERNAME")
95+
password = System.getenv("OSSRH_PASSWORD")
96+
publishingType = "USER_MANAGED"
97+
}
98+
99+
// Publish all projects that apply the 'maven-publish' plugin
100+
publishAllProjectsProbablyBreakingProjectIsolation()
101+
}

gradle/libs.versions.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
5959
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
6060
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
6161
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
62+
nmcp = "com.gradleup.nmcp.aggregation:1.3.0"
6263
shadow = "com.gradleup.shadow:9.2.2"
6364
spotless = "com.diffplug.spotless:8.0.0"
6465

tools/cli/build.gradle.kts

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ plugins {
99
application
1010
}
1111

12+
java {
13+
withSourcesJar()
14+
withJavadocJar()
15+
}
16+
1217
val baseName = "valkyrie"
1318
val versionName = cli.versions.cli.version.get()
1419

@@ -126,11 +131,13 @@ publishing {
126131
version = versionName
127132

128133
from(components["shadow"])
134+
artifact(tasks["sourcesJar"])
135+
artifact(tasks["javadocJar"])
129136

130137
pom {
131138
name = "Valkyrie CLI"
132139
description = "CLI tool for converting SVG/XML to Compose ImageVector and managing icon packs"
133-
url = "https://github.com/composegears/valkyrie"
140+
url = "https://github.com/ComposeGears/Valkyrie"
134141

135142
licenses {
136143
license {
@@ -142,18 +149,16 @@ publishing {
142149
scm {
143150
connection = "scm:git:git://github.com/composegears/valkyrie.git"
144151
developerConnection = "scm:git:ssh://github.com:composegears/valkyrie.git"
145-
url = "https://github.com/composegears/valkyrie"
152+
url = "https://github.com/ComposeGears/Valkyrie"
146153
}
147-
}
148-
}
149-
}
150-
repositories {
151-
maven {
152-
url = uri("https://central.sonatype.com/publishing/deployments")
153154

154-
credentials {
155-
username = System.getenv("OSSRH_USERNAME")
156-
password = System.getenv("OSSRH_PASSWORD")
155+
developers {
156+
developer {
157+
id = "composegears"
158+
name = "ComposeGears"
159+
url = "https://github.com/ComposeGears"
160+
}
161+
}
157162
}
158163
}
159164
}

0 commit comments

Comments
 (0)