This is an automated email from the ASF dual-hosted git repository. jdaugherty pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/grails-intellij-plugin.git
commit f3aeee1be8e1f45a1e0db5fbec3f3e408ab7f615 Author: James Daugherty <[email protected]> AuthorDate: Sat Jul 18 15:43:08 2026 -0400 Publish plugin ZIP to ASF Maven repository --- .github/workflows/release.yml | 13 +++++++++ build.gradle.kts | 62 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 06569dd..438162c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -84,6 +84,13 @@ jobs: ${DIST_NAME}-${VERSION}-bin.zip - name: "📦 Create plugin ZIP checksum" run: sha512sum ${DIST_NAME}-${VERSION}-bin.zip > ${DIST_NAME}-${VERSION}-bin.zip.sha512 + - name: "📤 Stage Maven artifacts to repository.apache.org" + env: + ASF_NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} + ASF_NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} + SIGNING_KEY: ${{ secrets.GRAILS_GPG_KEY }} + SIGNING_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + run: ./gradlew publishPluginZipPublicationToApacheRepository -PpluginVersion=${VERSION} - name: "🚀 Upload plugin ZIP to GitHub Release" uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0 with: @@ -259,6 +266,12 @@ jobs: PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }} PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }} run: ./gradlew publishPlugin -PpluginVersion=${VERSION} + - name: "🚀 MANUAL - Release Maven staging repository" + run: | + echo "::group::Manual Nexus Staging Release" + echo "Log in to https://repository.apache.org, find the org.apache.grails staging" + echo "repository for ${VERSION}, and Release it (artifacts sync to Maven Central)." + echo "::endgroup::" - name: "✅ MANUAL - Update ASF Reporter" run: | echo "::group::Manual ASF Reporter Update" diff --git a/build.gradle.kts b/build.gradle.kts index dd8c831..b902dfa 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -23,6 +23,8 @@ plugins { id("org.jetbrains.kotlin.jvm") version "2.3.0" id("org.jetbrains.intellij.platform") version "2.11.0" id("org.nosphere.apache.rat") version "0.8.1" + id("maven-publish") + id("signing") } group = "org.apache.grails.intellij" @@ -223,3 +225,63 @@ tasks.rat { // never cache license audits outputs.upToDateWhen { false } } + +// Publish the plugin ZIP to the ASF Nexus (repository.apache.org). Maven coordinates +// are independent of the JetBrains Marketplace plugin id (org.intellij.grails). +publishing { + publications { + create<MavenPublication>("pluginZip") { + groupId = "org.apache.grails" + artifactId = "grails-intellij-plugin" + version = project.version.toString() + artifact(tasks.buildPlugin) + pom { + name = "Apache Grails IntelliJ Plugin" + description = "IntelliJ IDEA plugin for the Apache Grails framework" + url = "https://github.com/apache/grails-intellij-plugin" + licenses { + license { + name = "The Apache License, Version 2.0" + url = "https://www.apache.org/licenses/LICENSE-2.0.txt" + } + } + scm { + connection = "scm:git:git://github.com/apache/grails-intellij-plugin.git" + developerConnection = "scm:git:ssh://github.com:apache/grails-intellij-plugin.git" + url = "https://github.com/apache/grails-intellij-plugin" + } + developers { + developer { + name = "Apache Grails Team" + url = "https://grails.apache.org/" + } + } + } + } + } + repositories { + maven { + name = "apache" + url = uri( + if (version.toString().endsWith("SNAPSHOT")) { + "https://repository.apache.org/content/repositories/snapshots" + } else { + "https://repository.apache.org/service/local/staging/deploy/maven2" + } + ) + credentials { + username = providers.environmentVariable("ASF_NEXUS_USERNAME").orNull + password = providers.environmentVariable("ASF_NEXUS_PASSWORD").orNull + } + } + } +} + +// GPG-sign the Maven publication (ASF release requirement); no-op when the key is absent +signing { + val signingKey = providers.environmentVariable("SIGNING_KEY").orNull + if (signingKey != null) { + useInMemoryPgpKeys(signingKey, providers.environmentVariable("SIGNING_PASSPHRASE").orNull ?: "") + sign(publishing.publications["pluginZip"]) + } +}
