Skip to content

Commit

Permalink
[#1322] BUILD: automate closing the Sonatype repository and releasing…
Browse files Browse the repository at this point in the history
… artifacts
  • Loading branch information
remkop committed Nov 6, 2021
1 parent e00cce8 commit c0dbc31
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 13 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ buildscript {
classpath 'org.asciidoctor:asciidoctorj-pdf:1.5.4'
classpath "gradle.plugin.org.beryx:badass-jar:1.1.3"
classpath 'biz.aQute.bnd:biz.aQute.bnd.gradle:5.1.2'
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.21.0"
}
}

Expand Down
10 changes: 10 additions & 0 deletions gradle/publish-mavencentral.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
// This build file is based on/inspired by https://autsoft.net/publishing-an-android-library-to-mavencentral-in-2019/

apply plugin: 'java'
apply plugin: 'distribution'
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'io.codearte.nexus-staging'


task javadocJar(type: Jar, dependsOn: javadoc) {
Expand Down Expand Up @@ -130,3 +133,10 @@ publishing {
signing {
sign publishing.publications
}

nexusStaging {
packageGroup = PUBLISH_GROUP_ID
stagingProfileId = '5db36034f05d47' // Log in to https://oss.sonatype.org/, go to Staging profiles, select your profile, and look at the ID in the URL
username = ossrhUsername
password = ossrhPassword
}
27 changes: 14 additions & 13 deletions gradle/release-tasks.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ task copyDocs(type: Copy) {
into 'docs'
}


/*
Release procedure:
1. edit version numbers: remove -SNAPSHOT classifier; edit releaseDate
Expand All @@ -121,20 +120,22 @@ Release procedure:
7a update README.md (latest version, release notes)
8. commit -m "Release picocli version ..."
9. tag v$version
10. ./gradlew publishReleasePublicationToSonatypeRepository - creates staging repository, and uploads artifacts
// for automation: stagingProfileId = '5db36034f05d47'
11. edit version numbers: increase minor version and add -SNAPSHOT classifier
12. ./gradlew bumpVersion
13. check modified files
14. commit -m "Prepare for next development cycle"
15. push (make sure that Push Tags is checked)
10 ./gradlew publishReleasePublicationToSonatypeRepository - creates a Sonatype staging repository, and uploads artifacts
11. Close the Sonatype info/picocli staging repo:
a. Manually: Log in to https://oss.sonatype.org/ and in the menu on the left, select Staging repositories.
Click the close button in the GUI and watch progress in the
b. Automatically with the codearte.nexus-staging plugin:
./gradlew closeAndReleaseRepository
16. Log in to GitHub, go to https://github.com/remkop/picocli/releases
17. Click the new tag, click Edit button, update title and release notes (copy from RELEASE-NOTES.md)
18. Upload picocli-$version.jar and picocli-all$version.zip to GitHub
12. edit version numbers: increase minor version and add -SNAPSHOT classifier
13. ./gradlew bumpVersion
14. check modified files
15. commit -m "Prepare for next development cycle"
16. push (make sure that Push Tags is checked)
19. Log in to https://oss.sonatype.org/ . In the menu on the left, select Staging repositories.
17. Log in to GitHub, go to https://github.com/remkop/picocli/releases
18. Click the new tag, click Edit button, update title and release notes (copy from RELEASE-NOTES.md)
19. Upload picocli-$version.jar and picocli-all$version.zip to GitHub
(When releasing from branch)
Expand Down

0 comments on commit c0dbc31

Please sign in to comment.