-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate to use com.vanniktech.maven.publish #201
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,17 +21,17 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
- name: Validate Gradle wrapper | ||
uses: gradle/wrapper-validation-action@v3 | ||
uses: gradle/actions/wrapper-validation@v3 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 11 | ||
check-latest: true | ||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
- name: Build | ||
uses: gradle/gradle-build-action@v3 | ||
with: | ||
arguments: build --info | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
run: ./gradlew build --info | ||
- name: Publish unit test results (Ubuntu) | ||
uses: EnricoMi/publish-unit-test-result-action@v2 | ||
if: always() && matrix.os == 'ubuntu-latest' | ||
|
@@ -40,14 +40,14 @@ jobs: | |
comment_mode: off | ||
check_name: "Test Results (Ubuntu)" | ||
- name: Publish unit test results (Windows) | ||
uses: EnricoMi/publish-unit-test-result-action/composite@v2 | ||
uses: EnricoMi/publish-unit-test-result-action/windows@v2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
if: always() && matrix.os == 'windows-latest' | ||
with: | ||
files: "**/test-results/**/*.xml" | ||
comment_mode: off | ||
check_name: "Test Results (Windows)" | ||
- name: Publish unit test results (MacOS) | ||
uses: EnricoMi/publish-unit-test-result-action/composite@v2 | ||
uses: EnricoMi/publish-unit-test-result-action/macos@v2 | ||
if: always() && matrix.os == 'macos-latest' | ||
with: | ||
files: "**/test-results/**/*.xml" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,27 +16,27 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
- name: Validate Gradle wrapper | ||
uses: gradle/wrapper-validation-action@v3 | ||
uses: gradle/actions/wrapper-validation@v3 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 11 | ||
check-latest: true | ||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
- name: Publish | ||
uses: gradle/gradle-build-action@v3 | ||
with: | ||
arguments: | | ||
publishMainPublicationToSonatypeRepository | ||
closeAndReleaseSonatypeStagingRepository | ||
publishPlugins | ||
-Dorg.gradle.internal.http.socketTimeout=120000 | ||
-Dorg.gradle.internal.network.retry.max.attempts=1 | ||
-Dorg.gradle.internal.publish.checksums.insecure=true | ||
run: | | ||
./gradlew | ||
publishToMavenCentral | ||
publishPlugins | ||
--no-configuration-cache | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
-Dorg.gradle.internal.http.socketTimeout=120000 | ||
-Dorg.gradle.internal.network.retry.max.attempts=1 | ||
env: | ||
OSSRH_USERNAME: ${{ secrets.SONATYPE_USER }} | ||
OSSRH_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | ||
PGP_KEY: ${{ secrets.GPG_KEY_ARMORED }} | ||
PGP_PASSWORD: ${{ secrets.GPG_PASSPHRASE }} | ||
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USER }} | ||
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }} | ||
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY_ARMORED }} | ||
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_PASSPHRASE }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
GRADLE_PORTAL_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }} | ||
GRADLE_PORTAL_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }} |
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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rubensf - This is what we would change if we wanted to publish to central instead of 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.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/gradle/actions/blob/main/docs/deprecation-upgrade-guide.md#the-action-gradlewrapper-validation-action-has-been-replaced-by-gradleactionswrapper-validation