diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 847d18ddd..6b5383436 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,7 +21,7 @@ jobs: with: cache-read-only: true # Disable CC due to https://github.com/gradle/gradle/issues/22779 - - run: ./gradlew publish publishPlugins gitPublishCopy --no-configuration-cache + - run: ./gradlew release --no-configuration-cache env: GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_KEY }} GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_SECRET }} diff --git a/gradle.properties b/gradle.properties index 8d04bd12d..b34884eca 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,7 +13,7 @@ SONATYPE_HOST=DEFAULT RELEASE_SIGNING_ENABLED=true POM_NAME=Shadow Gradle Plugin -POM_DESCRIPTION=Gradle version of Maven's Shade plugin. +POM_DESCRIPTION=Gradle plugin to create fat/uber JARs, apply file transforms, and relocate packages for applications and libraries. Gradle version of Maven's Shade plugin. POM_INCEPTION_YEAR=2024 POM_URL=https://github.com/GradleUp/shadow diff --git a/gradle/publish.gradle b/gradle/publish.gradle index 8ead0b32b..4a4f6fe6b 100644 --- a/gradle/publish.gradle +++ b/gradle/publish.gradle @@ -1,8 +1,8 @@ apply plugin: "com.gradle.plugin-publish" apply plugin: "com.vanniktech.maven.publish" -group = providers.gradleProperty("GROUP") -version = providers.gradleProperty("VERSION_NAME") +group = providers.gradleProperty("GROUP").get() +version = providers.gradleProperty("VERSION_NAME").get() gradlePlugin { website = providers.gradleProperty("POM_URL") @@ -12,13 +12,22 @@ gradlePlugin { shadowPlugin { id = 'com.gradleup.shadow' implementationClass = 'com.github.jengelman.gradle.plugins.shadow.ShadowPlugin' - displayName = providers.gradleProperty("POM_NAME").orNull - description = providers.gradleProperty("POM_DESCRIPTION").orNull - tags.set(['onejar', 'shade', 'fatjar', 'uberjar']) + displayName = providers.gradleProperty("POM_NAME").get() + description = providers.gradleProperty("POM_DESCRIPTION").get() + tags = ['onejar', 'shade', 'fatjar', 'uberjar'] } } } tasks.named('publishPlugins') { + doFirst { + if (version.endsWith("SNAPSHOT")) { + throw new GradleException('Cannot publish SNAPSHOT versions to Plugin Portal!') + } + } notCompatibleWithConfigurationCache("https://github.com/gradle/gradle/issues/21283") } + +tasks.register('release') { + dependsOn tasks.named('publish'), tasks.named('publishPlugins'), tasks.named('gitPublishPush') +}