Skip to content
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

Setup gradle plugin for publishing #142

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 5 additions & 20 deletions .github/workflows/publish-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,11 @@ jobs:
NEXUS_USER: ${{ secrets.NEXUS_USER }}
NEXUS_PW: ${{ secrets.NEXUS_PW }}

# TODO: Need to figure out where to publish gradle plugin, see https://github.com/apache/incubator-pekko-grpc/issues/40
# gradle-plugin:
# name: Release gradle plugin
# runs-on: ubuntu-latest
# if: github.repository == 'apache/incubator-pekko-grpc'
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# with:
# # we don't know what commit the last tag was it's safer to get entire repo so previousStableVersion resolves
# fetch-depth: 0
#
# - name: Setup Java 8
# uses: actions/setup-java@v3
# with:
# distribution: temurin
# java-version: 8
#
# - name: Publish Plugin to Gradle Plugin Repository
# run: cd gradle-plugin && ./gradlew publishPlugins -Pgradle.publish.key='${{ secrets.GRADLE_PUBLISH_KEY }}' -Pgradle.publish.secret='${{ secrets.GRADLE_SECRET }}'
- name: Publish Plugin to Gradle Plugin Repository
run: cd gradle-plugin && ./gradlew publishToSonatype
env:
NEXUS_USER: ${{ secrets.NEXUS_USER }}
NEXUS_PW: ${{ secrets.NEXUS_PW }}

- name: Build Documentation
run: |-
Expand Down
47 changes: 36 additions & 11 deletions gradle-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
id 'java-gradle-plugin'
id 'maven-publish'
id 'com.palantir.git-version' version '0.10.1'
id 'com.gradle.plugin-publish' version '0.11.0'
id 'io.github.gradle-nexus.publish-plugin' version '1.0.0'
}

group = "org.apache.pekko"
Expand All @@ -23,18 +23,43 @@ gradlePlugin {
}
}

pluginBundle {
website = 'https://pekko.apache.org/docs/pekko-grpc/current/'
vcsUrl = 'https://github.com/apache/incubator-pekko-grpc'
description = 'Building streaming gRPC servers and clients on top of Apache Pekko Streams'
tags = ['pekko', 'streams', 'reactive']
publishing {
publications.withType(MavenPublication) {
pom {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of the pom details were outdated/missing. This data was retrieved by copying it from the pom of one of the sbt artifacts of this project

name = "pekko-grpc-gradle-plugin"
description = "Apache Pekko gRPC - Support for building streaming gRPC servers and clients on top of Pekko Streams."
url = "https://pekko.apache.org/"
licenses {
license {
name = "Apache-2.0"
url = "https://www.apache.org/licenses/LICENSE-2.0.html"
}
}
developers {
developer {
id = 'contributors'
name = 'Contributors'
url = 'https://github.com/apache/incubator-pekko-grpc/graphs/contributors'
email = '[email protected]'
}
}
scm {
connection = '[email protected]:apache/incubator-pekko-grpc'
url = 'https://github.com/apache/incubator-pekko-grpc'
}
}
}
}

plugins {
pekkoGrpcPlugin {
id = 'org.apache.pekko.grpc.gradle'
displayName = 'Apache Pekko gRPC'
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://repository.apache.org/"))
snapshotRepositoryUrl.set(uri("https://repository.apache.org/content/repositories/snapshots/"))
pjfanning marked this conversation as resolved.
Show resolved Hide resolved
username = System.getenv("NEXUS_USER")
password = System.getenv("NEXUS_PW")
}
}
}
}

jar {
Expand Down