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 double deployment of unwanted plugin marker to Maven Central #187

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ jobs:
- name: Clean Deployment
run: ./gradlew clean publish -Dorg.gradle.daemon=false

- name: Cleanup Unwanted Artifacts
run: |
echo "Removing unwanted scanPluginMarkerMaven artifacts"
rm -rf build/publications/scanPluginMarkerMaven

- name: Release with JReleaser
run: ./gradlew jreleaserFullRelease -Dorg.gradle.daemon=false --stacktrace -x test -x integrationTest
env:
Expand Down
11 changes: 11 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -183,5 +183,16 @@ jreleaser {
}
}

// Remove unwanted "scan" directory after publishing
Copy link
Contributor

Choose a reason for hiding this comment

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

If this is done "after publishing" would that mean the additional artifact would have been already uploaded to Central?

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 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.1.0-SNAPSHOT
Copy link
Contributor

Choose a reason for hiding this comment

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

There is no change in the plugin code, if the intention is to test this releasing a new version then it's better just to increment the patch number:

Suggested change
version=3.1.0-SNAPSHOT
version=3.0.1-SNAPSHOT

release.useAutomaticVersion=true
Loading