Skip to content

Commit f7f7f2f

Browse files
committed
Use nmcp plugin
1 parent 6e07a56 commit f7f7f2f

File tree

4 files changed

+58
-40
lines changed

4 files changed

+58
-40
lines changed

.github/workflows/cli-release.yml

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -46,42 +46,42 @@ 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
49+
- name: Build CLI distribution
50+
run: ./gradlew buildCLI
51+
52+
- name: Clean up existing release
53+
run: |
54+
gh release view ${{ env.RELEASE_TAG }} && gh release delete ${{ env.RELEASE_TAG }} -y --cleanup-tag
55+
56+
- name: Clean up previous snapshot release
57+
if: env.IS_SNAPSHOT == 'false'
58+
run: |
59+
gh release view cli-${{ env.VERSION_NAME }}-SNAPSHOT && gh release delete cli-${{ env.VERSION_NAME }}-SNAPSHOT -y --cleanup-tag
60+
61+
- name: Create GitHub release
62+
run: |
63+
gh release create ${{ env.RELEASE_TAG }} tools/cli/build/distributions/*.zip --generate-notes ${{ env.PRE_RELEASE_FLAG }}
5164
5265
- name: Publish to Maven Central
5366
if: env.IS_SNAPSHOT == 'false'
54-
run: ./gradlew :tools:cli:publish
67+
run: ./gradlew publishAggregationToCentralPortal
5568
env:
5669
OSSRH_USERNAME: ${{ secrets.ORG_MAVEN_CENTRAL_USERNAME }}
5770
OSSRH_PASSWORD: ${{ secrets.ORG_MAVEN_CENTRAL_PASSWORD }}
5871
PGP_KEY: ${{ secrets.PGP_KEY }}
5972
PGP_PASS: ${{ secrets.PGP_PAS }}
6073

61-
# - name: Clean up existing release
62-
# run: |
63-
# gh release view ${{ env.RELEASE_TAG }} && gh release delete ${{ env.RELEASE_TAG }} -y --cleanup-tag
64-
#
65-
# - name: Clean up previous snapshot release
66-
# if: env.IS_SNAPSHOT == 'false'
67-
# run: |
68-
# gh release view cli-${{ env.VERSION_NAME }}-SNAPSHOT && gh release delete cli-${{ env.VERSION_NAME }}-SNAPSHOT -y --cleanup-tag
69-
#
70-
# - name: Create GitHub release
71-
# run: |
72-
# gh release create ${{ env.RELEASE_TAG }} tools/cli/build/distributions/*.zip --generate-notes ${{ env.PRE_RELEASE_FLAG }}
73-
#
74-
# - name: Update Homebrew formula
75-
# uses: mislav/bump-homebrew-formula-action@v3
76-
# if: env.IS_SNAPSHOT == 'false'
77-
# with:
78-
# formula-name: valkyrie
79-
# formula-path: Formula/valkyrie.rb
80-
# tag-name: ${{ env.RELEASE_TAG }}
81-
# homebrew-tap: ComposeGears/homebrew-repo
82-
# download-url: https://github.com/ComposeGears/Valkyrie/releases/download/${{ env.RELEASE_TAG }}/valkyrie-cli-${{ env.VERSION_NAME }}.zip
83-
# commit-message: |
84-
# Bump {{formulaName}} {{version}}
85-
# env:
86-
# COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}
74+
- name: Update Homebrew formula
75+
uses: mislav/bump-homebrew-formula-action@v3
76+
if: env.IS_SNAPSHOT == 'false'
77+
with:
78+
formula-name: valkyrie
79+
formula-path: Formula/valkyrie.rb
80+
tag-name: ${{ env.RELEASE_TAG }}
81+
homebrew-tap: ComposeGears/homebrew-repo
82+
download-url: https://github.com/ComposeGears/Valkyrie/releases/download/${{ env.RELEASE_TAG }}/valkyrie-cli-${{ env.VERSION_NAME }}.zip
83+
commit-message: |
84+
Bump {{formulaName}} {{version}}
85+
env:
86+
COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}
8787

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.2.1"
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
@@ -8,6 +8,11 @@ plugins {
88
application
99
}
1010

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

@@ -116,11 +121,13 @@ publishing {
116121
version = versionName
117122

118123
from(components["shadow"])
124+
artifact(tasks["sourcesJar"])
125+
artifact(tasks["javadocJar"])
119126

120127
pom {
121128
name = "Valkyrie CLI"
122129
description = "CLI tool for converting SVG/XML to Compose ImageVector and managing icon packs"
123-
url = "https://github.com/composegears/valkyrie"
130+
url = "https://github.com/ComposeGears/Valkyrie"
124131

125132
licenses {
126133
license {
@@ -132,18 +139,16 @@ publishing {
132139
scm {
133140
connection = "scm:git:git://github.com/composegears/valkyrie.git"
134141
developerConnection = "scm:git:ssh://github.com:composegears/valkyrie.git"
135-
url = "https://github.com/composegears/valkyrie"
142+
url = "https://github.com/ComposeGears/Valkyrie"
136143
}
137-
}
138-
}
139-
}
140-
repositories {
141-
maven {
142-
url = uri("https://central.sonatype.com/publishing/deployments")
143144

144-
credentials {
145-
username = System.getenv("OSSRH_USERNAME")
146-
password = System.getenv("OSSRH_PASSWORD")
145+
developers {
146+
developer {
147+
id = "composegears"
148+
name = "ComposeGears"
149+
url = "https://github.com/ComposeGears"
150+
}
151+
}
147152
}
148153
}
149154
}

0 commit comments

Comments
 (0)