-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate to use com.vanniktech.maven.publish
Update the buf-gradle-plugin build to use the `com.vanniktech.maven.publish` plugin instead of the `io.github.gradle-nexus.publish-plugin`. Move all of the build configuration into `build.gradle.kts` and update CI workflows to migrate off deprecated GitHub actions and action inputs.
- Loading branch information
Showing
6 changed files
with
67 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import com.gradle.publish.PublishTask.GRADLE_PUBLISH_KEY | ||
import com.gradle.publish.PublishTask.GRADLE_PUBLISH_SECRET | ||
import com.vanniktech.maven.publish.SonatypeHost | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
repositories { | ||
|
@@ -12,11 +13,10 @@ plugins { | |
alias(libs.plugins.pluginPublish) | ||
alias(libs.plugins.spotless) | ||
alias(libs.plugins.animalsniffer) | ||
alias(libs.plugins.publishing) | ||
alias(libs.plugins.mavenPublish) | ||
} | ||
|
||
group = "build.buf" | ||
configurePublishing() | ||
|
||
allprojects { | ||
spotless { | ||
|
@@ -38,6 +38,14 @@ dependencies { | |
testImplementation(libs.truth) | ||
} | ||
|
||
object ProjectInfo { | ||
const val NAME = "Buf Gradle Plugin" | ||
const val URL = "https://github.com/bufbuild/buf-gradle-plugin" | ||
const val DESCRIPTION = "Buf plugin for Gradle" | ||
} | ||
|
||
fun isRelease() = !version.toString().endsWith("-SNAPSHOT") | ||
|
||
gradlePlugin { | ||
website.set(ProjectInfo.URL) | ||
vcsUrl.set(ProjectInfo.URL) | ||
|
@@ -61,7 +69,42 @@ kotlin { | |
} | ||
} | ||
|
||
mavenPublishing { | ||
publishToMavenCentral(SonatypeHost.S01) | ||
signAllPublications() | ||
pom { | ||
name.set(ProjectInfo.NAME) | ||
description.set(ProjectInfo.DESCRIPTION) | ||
url.set(ProjectInfo.URL) | ||
scm { | ||
url.set(ProjectInfo.URL) | ||
} | ||
licenses { | ||
license { | ||
name.set("The Apache License, Version 2.0") | ||
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt") | ||
} | ||
} | ||
developers { | ||
developer { | ||
id.set("Andrew Parmet") | ||
name.set("Andrew Parmet") | ||
email.set("[email protected]") | ||
} | ||
developer { | ||
id.set("bufbuild") | ||
name.set("Buf") | ||
email.set("[email protected]") | ||
url.set("https://buf.build") | ||
organization.set("Buf Technologies, Inc.") | ||
organizationUrl.set("https://buf.build") | ||
} | ||
} | ||
} | ||
} | ||
|
||
tasks { | ||
// Only enable publishing to the Gradle Portal for release builds. | ||
named("publishPlugins") { | ||
enabled = isRelease() | ||
} | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters