From 8d4ef90fa921325f52aac3d52047586250194f13 Mon Sep 17 00:00:00 2001 From: Andrzej Danilowski Date: Wed, 13 May 2026 15:05:13 +0200 Subject: [PATCH] release-1.11.0 --- .../close-and-release-repository.yml | 6 +- .github/workflows/github-actions.yml | 19 +++-- build.gradle | 82 +++---------------- .../libraries/jersey2/build.gradle.mustache | 79 ++++-------------- 4 files changed, 41 insertions(+), 145 deletions(-) diff --git a/.github/workflows/close-and-release-repository.yml b/.github/workflows/close-and-release-repository.yml index 4aed1f0..8f07b7e 100644 --- a/.github/workflows/close-and-release-repository.yml +++ b/.github/workflows/close-and-release-repository.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: repository: - description: 'Manually trigger gradle closeAndReleaseRepository task in case of timeout from previous publishing' + description: 'Manually trigger release in case of timeout from previous publishing' jobs: closeAndReleaseRepository: @@ -20,7 +20,9 @@ jobs: java-version: 11 - name: Publish Release to Maven Central - run: ./gradlew closeAndReleaseRepository --no-daemon --no-parallel --repository ${{ inputs.repository }} + run: ./gradlew publishAndReleaseToMavenCentral --no-daemon --no-parallel --no-configuration-cache --stacktrace env: ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }} ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }} + ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }} + ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }} diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 913f790..8a5616e 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -47,23 +47,26 @@ jobs: distribution: 'zulu' java-version: 11 - - name: Upload Artifacts - run: ./gradlew publishToMavenCentral --no-daemon --no-parallel --no-configuration-cache --stacktrace + - name: Retrieve version + run: echo "PACKAGE_VERSION=$(cat VERSION)" >> $GITHUB_ENV + + - name: Publish to Maven Central + run: ./gradlew publishAndReleaseToMavenCentral --no-daemon --no-parallel --no-configuration-cache --stacktrace + if: "!endsWith(env.PACKAGE_VERSION, '-SNAPSHOT')" env: ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }} ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }} ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }} ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }} - - name: Retrieve version - run: echo "PACKAGE_VERSION=$(cat VERSION)" >> $GITHUB_ENV - - - name: Publish Release to Maven Central - run: ./gradlew releaseRepository --no-daemon --no-parallel - if: "!endsWith(env.PACKAGE_VERSION, '-SNAPSHOT')" + - name: Publish Snapshot + run: ./gradlew publishToMavenCentral --no-daemon --no-parallel --no-configuration-cache --stacktrace + if: "endsWith(env.PACKAGE_VERSION, '-SNAPSHOT')" env: ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }} ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }} + ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }} + ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }} # This job runs on merging to "v1" branch # Creates a new tag using the value in the VERSION file diff --git a/build.gradle b/build.gradle index 47f85f3..c6751f8 100644 --- a/build.gradle +++ b/build.gradle @@ -1,44 +1,33 @@ -buildscript { - repositories { - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:2.3.+' - classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' - classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.25.0' - } -} plugins { + id 'java' id 'com.vanniktech.maven.publish' version '0.34.0' id 'com.diffplug.spotless' version '6.25.0' } -apply plugin: 'java' -apply plugin: 'maven-publish' -apply plugin: 'signing' - group = 'com.dropbox.sign' -archivesBaseName = 'dropbox-sign' version = '1.11.0' -sourceCompatibility = JavaVersion.VERSION_1_8 -targetCompatibility = JavaVersion.VERSION_1_8 + +base { + archivesName.set('dropbox-sign') +} + +java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} repositories { mavenCentral() } -tasks.withType(JavaCompile) { +tasks.withType(JavaCompile).configureEach { options.encoding = 'UTF-8' } -if (JavaVersion.current().isJava8Compatible()) { - tasks.withType(Javadoc) { - // disable the crazy super-strict doclint tool in Java 8 - //noinspection SpellCheckingInspection +tasks.withType(Javadoc).configureEach { options.addStringOption('Xdoclint:none', '-quiet') - } } task javadocJar(type: Jar) { @@ -68,53 +57,6 @@ artifacts { archives javadocJar, sourcesJar, fatJar } -publishing { - publications { - mavenJava(MavenPublication) { - pom { - name = 'Dropbox Sign' - packaging = 'jar' - // optionally artifactId can be defined here - artifactId = 'dropbox-sign' - description = 'Use the Dropbox SIgn Java SDK to connect your Java app to Dropbox Sign\'s service in microseconds!' - url = 'https://www.hellosign.com/' - - scm { - connection = 'scm:git:git://github.com/hellosign/dropbox-sign-java.git' - developerConnection = 'scm:git:git@github.com:hellosign/dropbox-sign-java.git' - url = 'https://github.com/hellosign/dropbox-sign-java' - } - - licenses { - license { - name = 'MIT License' - url = 'http://www.opensource.org/licenses/mit-license.php' - } - } - - developers { - developer { - name = 'Dropbox Sign API Team' - email = 'apisupport@hellosign.com' - url = 'https://www.hellosign.com' - } - } - } - } - } - repositories { - maven { - def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" - def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/" - url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl - credentials { - username findProperty('ossrhUsername') - password findProperty('ossrhPassword') - } - } - } -} - ext { swagger_annotations_version = "1.6.5" jackson_version = "2.17.1" diff --git a/templates/libraries/jersey2/build.gradle.mustache b/templates/libraries/jersey2/build.gradle.mustache index deeb879..2339cfe 100644 --- a/templates/libraries/jersey2/build.gradle.mustache +++ b/templates/libraries/jersey2/build.gradle.mustache @@ -7,6 +7,7 @@ group = '{{groupId}}' version = '{{artifactVersion}}' {{/useCustomTemplateCode}} +{{^useCustomTemplateCode}} buildscript { repositories { mavenCentral() @@ -14,30 +15,29 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:2.3.+' classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' -{{^useCustomTemplateCode}} classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.3.0' -{{/useCustomTemplateCode}} -{{#useCustomTemplateCode}} - classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.25.0' -{{/useCustomTemplateCode}} } } +{{/useCustomTemplateCode}} {{#useCustomTemplateCode}} plugins { + id 'java' id 'com.vanniktech.maven.publish' version '0.34.0' id 'com.diffplug.spotless' version '6.25.0' } -apply plugin: 'java' -apply plugin: 'maven-publish' -apply plugin: 'signing' - group = '{{groupId}}' -archivesBaseName = '{{artifactId}}' version = '{{artifactVersion}}' -sourceCompatibility = JavaVersion.VERSION_1_8 -targetCompatibility = JavaVersion.VERSION_1_8 + +base { + archivesName.set('{{artifactId}}') +} + +java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} {{/useCustomTemplateCode}} repositories { @@ -123,16 +123,12 @@ if(hasProperty('target') && target == 'android') { } {{/useCustomTemplateCode}} {{#useCustomTemplateCode}} -tasks.withType(JavaCompile) { +tasks.withType(JavaCompile).configureEach { options.encoding = 'UTF-8' } -if (JavaVersion.current().isJava8Compatible()) { - tasks.withType(Javadoc) { - // disable the crazy super-strict doclint tool in Java 8 - //noinspection SpellCheckingInspection +tasks.withType(Javadoc).configureEach { options.addStringOption('Xdoclint:none', '-quiet') - } } task javadocJar(type: Jar) { @@ -161,53 +157,6 @@ processResources { artifacts { archives javadocJar, sourcesJar, fatJar } - -publishing { - publications { - mavenJava(MavenPublication) { - pom { - name = 'Dropbox Sign' - packaging = 'jar' - // optionally artifactId can be defined here - artifactId = '{{artifactId}}' - description = 'Use the Dropbox SIgn Java SDK to connect your Java app to Dropbox Sign\'s service in microseconds!' - url = 'https://www.hellosign.com/' - - scm { - connection = '{{scmConnection}}' - developerConnection = '{{scmDeveloperConnection}}' - url = '{{scmUrl}}' - } - - licenses { - license { - name = '{{licenseName}}' - url = 'http://www.opensource.org/licenses/mit-license.php' - } - } - - developers { - developer { - name = '{{developerName}}' - email = '{{developerEmail}}' - url = 'https://www.hellosign.com' - } - } - } - } - } - repositories { - maven { - def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" - def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/" - url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl - credentials { - username findProperty('ossrhUsername') - password findProperty('ossrhPassword') - } - } - } -} {{/useCustomTemplateCode}} ext {