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

Fix pubishing to the Gradle Plugins portal #190

Merged
merged 1 commit into from
Jan 2, 2025
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
44 changes: 23 additions & 21 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
plugins {
id 'java-gradle-plugin'
id 'maven-publish'
id 'signing'
id 'net.researchgate.release' version '3.0.0'
id 'com.gradle.plugin-publish' version '0.21.0'
id 'com.gradle.plugin-publish' version '1.3.0'
id 'org.jreleaser' version '1.15.0'
}

apply from: 'gradle/integration-test.gradle'

// Plugin publishing configuration
def pluginDescription = 'Scan, evaluate and audit Gradle projects using Sonatype platforms'
def pluginUrl = 'https://github.com/sonatype-nexus-community/scan-gradle-plugin'

gradlePlugin {
plugins {
Expand All @@ -18,6 +17,11 @@ gradlePlugin {
implementationClass = 'org.sonatype.gradle.plugins.scan.ScanPlugin'
displayName = project.name
description = pluginDescription
website = pluginUrl
vcsUrl = pluginUrl
tags.set(['sonatype', 'scan', 'dependencies', 'ossindex', 'iq server', 'lifecycle'])
System.setProperty('gradle.publish.key', System.getenv('GRADLE_PUBLISH_KEY') ?: '')
System.setProperty('gradle.publish.secret', System.getenv('GRADLE_PUBLISH_SECRET') ?: '')
}
}
}
Expand Down Expand Up @@ -134,24 +138,11 @@ publishing {
}
}


// Plugin publishing configuration
def pluginUrl = 'https://github.com/sonatype-nexus-community/scan-gradle-plugin'
pluginBundle {
website = pluginUrl
vcsUrl = pluginUrl
description = pluginDescription
tags = ['sonatype', 'scan', 'dependencies', 'ossindex', 'iq server']
System.setProperty('gradle.publish.key', System.getenv('GRADLE_PUBLISH_KEY') ?: '')
System.setProperty('gradle.publish.secret', System.getenv('GRADLE_PUBLISH_SECRET') ?: '')
}


jreleaser {
project {
name = 'scan-gradle-plugin'
description = 'Scan, evaluate and audit Gradle projects using Sonatype platforms'
website = 'https://github.com/sonatype-nexus-community/scan-gradle-plugin'
description = pluginDescription
website = pluginUrl
}
signing {
active = 'ALWAYS'
Expand All @@ -167,7 +158,6 @@ jreleaser {
if (secretKey) {
System.setProperty('jreleaser.gpg.secret.key', secretKey)
}

}
deploy {
maven {
Expand All @@ -183,5 +173,17 @@ jreleaser {
}
}

// Remove unwanted "scan" directory after publishing
tasks.register('cleanupUnwantedArtifacts') {
doLast {
def unwantedDir = file("build/staging-deploy/org/sonatype/gradle/plugins/scan")
if (unwantedDir.exists()) {
println "Removing unwanted directory: $unwantedDir"
delete unwantedDir
}
}
}

afterReleaseBuild.dependsOn publish
// publish.finalizedBy publishPlugins
publish.finalizedBy cleanupUnwantedArtifacts
publish.finalizedBy publishPlugins
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
#

group=org.sonatype.gradle.plugins
version=3.0.0-SNAPSHOT
version=3.0.1-SNAPSHOT
release.useAutomaticVersion=true
Loading