Skip to content

Commit 1998948

Browse files
Release 2.7.0 (#48)
1 parent e909d1c commit 1998948

4 files changed

Lines changed: 41 additions & 145 deletions

File tree

.github/workflows/close-and-release-repository.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
inputs:
66
repository:
7-
description: 'Manually trigger gradle closeAndReleaseRepository task in case of timeout from previous publishing'
7+
description: 'Manually trigger release in case of timeout from previous publishing'
88

99
jobs:
1010
closeAndReleaseRepository:
@@ -20,7 +20,9 @@ jobs:
2020
java-version: 11
2121

2222
- name: Publish Release to Maven Central
23-
run: ./gradlew closeAndReleaseRepository --no-daemon --no-parallel --repository ${{ inputs.repository }}
23+
run: ./gradlew publishAndReleaseToMavenCentral --no-daemon --no-parallel --no-configuration-cache --stacktrace
2424
env:
2525
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
2626
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
27+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
28+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}

.github/workflows/github-actions.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,23 +47,26 @@ jobs:
4747
distribution: 'zulu'
4848
java-version: 11
4949

50-
- name: Upload Artifacts
51-
run: ./gradlew publishToMavenCentral --no-daemon --no-parallel --no-configuration-cache --stacktrace
50+
- name: Retrieve version
51+
run: echo "PACKAGE_VERSION=$(cat VERSION)" >> $GITHUB_ENV
52+
53+
- name: Publish to Maven Central
54+
run: ./gradlew publishAndReleaseToMavenCentral --no-daemon --no-parallel --no-configuration-cache --stacktrace
55+
if: "!endsWith(env.PACKAGE_VERSION, '-SNAPSHOT')"
5256
env:
5357
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
5458
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
5559
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
5660
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
5761

58-
- name: Retrieve version
59-
run: echo "PACKAGE_VERSION=$(cat VERSION)" >> $GITHUB_ENV
60-
61-
- name: Publish Release to Maven Central
62-
run: ./gradlew releaseRepository --no-daemon --no-parallel
63-
if: "!endsWith(env.PACKAGE_VERSION, '-SNAPSHOT')"
62+
- name: Publish Snapshot
63+
run: ./gradlew publishToMavenCentral --no-daemon --no-parallel --no-configuration-cache --stacktrace
64+
if: "endsWith(env.PACKAGE_VERSION, '-SNAPSHOT')"
6465
env:
6566
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
6667
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
68+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
69+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
6770

6871
# This job runs on merging to "main" branch
6972
# Creates a new tag using the value in the VERSION file

build.gradle

Lines changed: 12 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,33 @@
11

2-
buildscript {
3-
repositories {
4-
mavenCentral()
5-
}
6-
dependencies {
7-
classpath 'com.android.tools.build:gradle:2.3.+'
8-
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
9-
classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.25.0'
10-
}
11-
}
122

133
plugins {
4+
id 'java'
145
id 'com.vanniktech.maven.publish' version '0.34.0'
156
id 'com.diffplug.spotless' version '6.25.0'
167
}
178

18-
apply plugin: 'java'
19-
apply plugin: 'maven-publish'
20-
apply plugin: 'signing'
21-
229
group = 'com.dropbox.sign'
23-
archivesBaseName = 'dropbox-sign'
2410
version = '2.7.0'
25-
sourceCompatibility = JavaVersion.VERSION_1_8
26-
targetCompatibility = JavaVersion.VERSION_1_8
11+
12+
base {
13+
archivesName.set('dropbox-sign')
14+
}
15+
16+
java {
17+
sourceCompatibility = JavaVersion.VERSION_1_8
18+
targetCompatibility = JavaVersion.VERSION_1_8
19+
}
2720

2821
repositories {
2922
mavenCentral()
3023
}
3124

32-
tasks.withType(JavaCompile) {
25+
tasks.withType(JavaCompile).configureEach {
3326
options.encoding = 'UTF-8'
3427
}
3528

36-
if (JavaVersion.current().isJava8Compatible()) {
37-
tasks.withType(Javadoc) {
38-
// disable the crazy super-strict doclint tool in Java 8
39-
//noinspection SpellCheckingInspection
29+
tasks.withType(Javadoc).configureEach {
4030
options.addStringOption('Xdoclint:none', '-quiet')
41-
}
4231
}
4332

4433
task javadocJar(type: Jar) {
@@ -68,53 +57,6 @@ artifacts {
6857
archives javadocJar, sourcesJar, fatJar
6958
}
7059

71-
publishing {
72-
publications {
73-
mavenJava(MavenPublication) {
74-
pom {
75-
name = 'Dropbox Sign'
76-
packaging = 'jar'
77-
// optionally artifactId can be defined here
78-
artifactId = 'dropbox-sign'
79-
description = 'Use the Dropbox SIgn Java SDK to connect your Java app to Dropbox Sign\'s service in microseconds!'
80-
url = 'https://www.hellosign.com/'
81-
82-
scm {
83-
connection = 'scm:git:git://github.com/hellosign/dropbox-sign-java.git'
84-
developerConnection = 'scm:git:git@github.com:hellosign/dropbox-sign-java.git'
85-
url = 'https://github.com/hellosign/dropbox-sign-java'
86-
}
87-
88-
licenses {
89-
license {
90-
name = 'MIT License'
91-
url = 'http://www.opensource.org/licenses/mit-license.php'
92-
}
93-
}
94-
95-
developers {
96-
developer {
97-
name = 'Dropbox Sign API Team'
98-
email = 'apisupport@hellosign.com'
99-
url = 'https://www.hellosign.com'
100-
}
101-
}
102-
}
103-
}
104-
}
105-
repositories {
106-
maven {
107-
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
108-
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
109-
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
110-
credentials {
111-
username findProperty('ossrhUsername')
112-
password findProperty('ossrhPassword')
113-
}
114-
}
115-
}
116-
}
117-
11860
ext {
11961
swagger_annotations_version = "1.6.5"
12062
jackson_version = "2.17.1"

templates/libraries/jersey3/build.gradle.mustache

Lines changed: 14 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,37 @@ group = '{{groupId}}'
77
version = '{{artifactVersion}}'
88
{{/useCustomTemplateCode}}
99

10+
{{^useCustomTemplateCode}}
1011
buildscript {
1112
repositories {
1213
mavenCentral()
1314
}
1415
dependencies {
1516
classpath 'com.android.tools.build:gradle:2.3.+'
1617
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
17-
{{^useCustomTemplateCode}}
1818
classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.3.0'
19-
{{/useCustomTemplateCode}}
20-
{{#useCustomTemplateCode}}
21-
classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.25.0'
22-
{{/useCustomTemplateCode}}
2319
}
2420
}
21+
{{/useCustomTemplateCode}}
2522

2623
{{#useCustomTemplateCode}}
2724
plugins {
25+
id 'java'
2826
id 'com.vanniktech.maven.publish' version '0.34.0'
2927
id 'com.diffplug.spotless' version '6.25.0'
3028
}
3129

32-
apply plugin: 'java'
33-
apply plugin: 'maven-publish'
34-
apply plugin: 'signing'
35-
3630
group = '{{groupId}}'
37-
archivesBaseName = '{{artifactId}}'
3831
version = '{{artifactVersion}}'
39-
sourceCompatibility = JavaVersion.VERSION_1_8
40-
targetCompatibility = JavaVersion.VERSION_1_8
32+
33+
base {
34+
archivesName.set('{{artifactId}}')
35+
}
36+
37+
java {
38+
sourceCompatibility = JavaVersion.VERSION_1_8
39+
targetCompatibility = JavaVersion.VERSION_1_8
40+
}
4141

4242
{{/useCustomTemplateCode}}
4343
repositories {
@@ -123,16 +123,12 @@ if(hasProperty('target') && target == 'android') {
123123
}
124124
{{/useCustomTemplateCode}}
125125
{{#useCustomTemplateCode}}
126-
tasks.withType(JavaCompile) {
126+
tasks.withType(JavaCompile).configureEach {
127127
options.encoding = 'UTF-8'
128128
}
129129

130-
if (JavaVersion.current().isJava8Compatible()) {
131-
tasks.withType(Javadoc) {
132-
// disable the crazy super-strict doclint tool in Java 8
133-
//noinspection SpellCheckingInspection
130+
tasks.withType(Javadoc).configureEach {
134131
options.addStringOption('Xdoclint:none', '-quiet')
135-
}
136132
}
137133

138134
task javadocJar(type: Jar) {
@@ -161,53 +157,6 @@ processResources {
161157
artifacts {
162158
archives javadocJar, sourcesJar, fatJar
163159
}
164-
165-
publishing {
166-
publications {
167-
mavenJava(MavenPublication) {
168-
pom {
169-
name = 'Dropbox Sign'
170-
packaging = 'jar'
171-
// optionally artifactId can be defined here
172-
artifactId = '{{artifactId}}'
173-
description = 'Use the Dropbox SIgn Java SDK to connect your Java app to Dropbox Sign\'s service in microseconds!'
174-
url = 'https://www.hellosign.com/'
175-
176-
scm {
177-
connection = '{{scmConnection}}'
178-
developerConnection = '{{scmDeveloperConnection}}'
179-
url = '{{scmUrl}}'
180-
}
181-
182-
licenses {
183-
license {
184-
name = '{{licenseName}}'
185-
url = 'http://www.opensource.org/licenses/mit-license.php'
186-
}
187-
}
188-
189-
developers {
190-
developer {
191-
name = '{{developerName}}'
192-
email = '{{developerEmail}}'
193-
url = 'https://www.hellosign.com'
194-
}
195-
}
196-
}
197-
}
198-
}
199-
repositories {
200-
maven {
201-
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
202-
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
203-
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
204-
credentials {
205-
username findProperty('ossrhUsername')
206-
password findProperty('ossrhPassword')
207-
}
208-
}
209-
}
210-
}
211160
{{/useCustomTemplateCode}}
212161

213162
ext {

0 commit comments

Comments
 (0)