Skip to content

Commit 0a0b7df

Browse files
committed
SDK regeneration
1 parent 8160511 commit 0a0b7df

File tree

2 files changed

+58
-49
lines changed

2 files changed

+58
-49
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,8 @@ jobs:
3636

3737
- name: Test
3838
run: ./gradlew test
39-
env:
40-
TEST_SQUARE_TOKEN: ${{ secrets.TEST_SQUARE_TOKEN }}
41-
4239
publish:
43-
needs: [ compile ]
40+
needs: [ compile, test ]
4441
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
4542
runs-on: ubuntu-latest
4643

@@ -55,10 +52,10 @@ jobs:
5552
java-version: "11"
5653
architecture: x64
5754

58-
- name: Publish to Maven Central
59-
run: ./gradlew publish --stacktrace
55+
- name: Publish to maven
56+
run: |
57+
./gradlew publish
6058
env:
61-
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_CENTRAL_USERNAME }}
62-
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_CENTRAL_PASSWORD }}
63-
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SECRET_KEY }}
64-
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_SECRET_PASSPHRASE }}
59+
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
60+
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
61+
MAVEN_PUBLISH_REGISTRY_URL: "https://s01.oss.sonatype.org/content/repositories/releases/"

build.gradle

Lines changed: 51 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
plugins {
22
id 'java-library'
3+
id 'maven-publish'
34
id 'com.diffplug.spotless' version '6.11.0'
4-
id 'com.vanniktech.maven.publish' version '0.27.0'
55
}
66

77
repositories {
88
mavenCentral()
9+
maven {
10+
url 'https://s01.oss.sonatype.org/content/repositories/releases/'
11+
}
912
}
1013

1114
dependencies {
@@ -17,6 +20,7 @@ dependencies {
1720
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
1821
}
1922

23+
2024
sourceCompatibility = 1.8
2125
targetCompatibility = 1.8
2226

@@ -31,58 +35,66 @@ spotless {
3135
}
3236
}
3337

38+
39+
java {
40+
withSourcesJar()
41+
withJavadocJar()
42+
}
43+
44+
3445
group = 'com.squareup'
46+
3547
version = '45.0.0.20250618'
3648

49+
jar {
50+
dependsOn(":generatePomFileForMavenPublication")
51+
archiveBaseName = "square"
52+
}
53+
54+
sourcesJar {
55+
archiveBaseName = "square"
56+
}
57+
58+
javadocJar {
59+
archiveBaseName = "square"
60+
}
61+
3762
test {
3863
useJUnitPlatform()
3964
testLogging {
4065
showStandardStreams = true
4166
}
4267
}
4368

44-
// Configure maven publishing for Central Portal
45-
mavenPublishing {
46-
publishToMavenCentral()
47-
signAllPublications()
48-
49-
coordinates("com.squareup", "square", "$version")
50-
51-
pom {
52-
name = "Square Java SDK"
53-
description = "Official Square Java SDK"
54-
inceptionYear = "2019"
55-
url = "https://github.com/square/square-java-sdk"
56-
57-
licenses {
58-
license {
59-
name = "MIT License"
60-
url = "https://opensource.org/licenses/MIT"
61-
distribution = "repo"
69+
publishing {
70+
publications {
71+
maven(MavenPublication) {
72+
groupId = 'com.squareup'
73+
artifactId = 'square'
74+
version = '45.0.0.20250618'
75+
from components.java
76+
pom {
77+
licenses {
78+
license {
79+
name = 'MIT'
80+
}
81+
}
82+
scm {
83+
connection = 'scm:git:git://github.com/square/square-java-sdk.git'
84+
developerConnection = 'scm:git:git://github.com/square/square-java-sdk.git'
85+
url = 'https://github.com/square/square-java-sdk'
86+
}
6287
}
6388
}
64-
65-
developers {
66-
developer {
67-
id = "square"
68-
name = "Square"
69-
url = "https://github.com/square"
89+
}
90+
repositories {
91+
maven {
92+
url "$System.env.MAVEN_PUBLISH_REGISTRY_URL"
93+
credentials {
94+
username "$System.env.MAVEN_USERNAME"
95+
password "$System.env.MAVEN_PASSWORD"
7096
}
7197
}
72-
73-
scm {
74-
url = "https://github.com/square/square-java-sdk"
75-
connection = "scm:git:git://github.com/square/square-java-sdk.git"
76-
developerConnection = "scm:git:ssh://[email protected]/square/square-java-sdk.git"
77-
}
7898
}
7999
}
80100

81-
java {
82-
withSourcesJar()
83-
withJavadocJar()
84-
85-
toolchain {
86-
languageVersion = JavaLanguageVersion.of(8)
87-
}
88-
}

0 commit comments

Comments
 (0)