Skip to content

Commit 0555313

Browse files
committed
chore: Hoxton.SR12 + Central Portal publish (minimal from 0.6.0)
- Hoxton.SR1 -> SR12 (Boot 2.2.0 kept, least behavioral change) - distributionManagement bintray/jfrog -> central.sonatype.com (maven-releases/snapshots) - add maven-gpg 3.2.7 + github profile for maven.pkg.github.com - ci.yml v* semver tags, publish to GitHub always + Central when secrets present, GPG via setup-java - keep code as 0.6.0, no driver/websocket breakage
1 parent 5d5ec88 commit 0555313

3 files changed

Lines changed: 137 additions & 18 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 90 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches:
66
- master
77
tags:
8-
- "*"
8+
- "v*"
99
pull_request:
1010
branches:
1111
- master
@@ -112,3 +112,92 @@ jobs:
112112

113113
- name: Run classpath tests
114114
run: make PROFILES=${{ matrix.profile }} classpath
115+
116+
publish:
117+
name: Publish to Maven Central
118+
needs: [test, classpath]
119+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
120+
runs-on: ubuntu-24.04
121+
permissions:
122+
contents: read
123+
packages: write
124+
env:
125+
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
126+
steps:
127+
- name: Checkout repository
128+
uses: actions/checkout@v7
129+
with:
130+
fetch-depth: 0
131+
persist-credentials: false
132+
133+
- name: Set up Java
134+
uses: actions/setup-java@v6
135+
with:
136+
distribution: temurin
137+
java-version: '11'
138+
cache: maven
139+
server-id: central
140+
server-username: CENTRAL_USERNAME
141+
server-password: CENTRAL_TOKEN
142+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
143+
gpg-passphrase: GPG_PASSPHRASE
144+
145+
- name: Verify tag matches pom version
146+
run: |
147+
TAG_VERSION=${GITHUB_REF#refs/tags/v}
148+
POM_VERSION=$(./mvnw help:evaluate -N -Dexpression=project.version -q -DforceStdout | grep -v '\[')
149+
echo "Tag version: $TAG_VERSION"
150+
echo "POM version: $POM_VERSION"
151+
if [[ "$POM_VERSION" != "$TAG_VERSION" ]]; then
152+
echo "::error::Tag $TAG_VERSION does not match pom $POM_VERSION"
153+
echo "::warning::Tag $TAG_VERSION does not match pom $POM_VERSION (expected if release:prepare not used with v prefix))"
154+
exit 1
155+
fi
156+
157+
- name: Publish to GitHub Packages
158+
run: ./mvnw --batch-mode -Pgithub -DskipTests deploy
159+
160+
- name: Publish release to Maven Central
161+
if: ${{ env.CENTRAL_USERNAME != '' }}
162+
env:
163+
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
164+
CENTRAL_TOKEN: ${{ secrets.CENTRAL_TOKEN }}
165+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
166+
run: ./mvnw --batch-mode -Prelease -DskipTests deploy
167+
168+
snapshot:
169+
name: Publish snapshot
170+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
171+
runs-on: ubuntu-24.04
172+
needs: [test, classpath]
173+
permissions:
174+
contents: read
175+
packages: write
176+
env:
177+
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
178+
steps:
179+
- name: Checkout repository
180+
uses: actions/checkout@v7
181+
with:
182+
fetch-depth: 0
183+
persist-credentials: false
184+
185+
- name: Set up Java
186+
uses: actions/setup-java@v6
187+
with:
188+
distribution: temurin
189+
java-version: '11'
190+
cache: maven
191+
server-id: github
192+
server-username: GITHUB_ACTOR
193+
server-password: GITHUB_TOKEN
194+
195+
- name: Publish snapshot to GitHub Packages
196+
run: ./mvnw --batch-mode -Pgithub -DskipTests deploy
197+
198+
- name: Publish snapshot to Maven Central
199+
if: ${{ env.CENTRAL_USERNAME != '' }}
200+
env:
201+
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
202+
CENTRAL_TOKEN: ${{ secrets.CENTRAL_TOKEN }}
203+
run: ./mvnw --batch-mode -DskipTests deploy

‎.settings.xml‎

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,14 @@
2222
http://maven.apache.org/xsd/settings-1.0.0.xsd">
2323
<servers>
2424
<server>
25-
<id>sonatype</id>
26-
<username>${env.SONATYPE_USER}</username>
27-
<password>${env.SONATYPE_PASSWORD}</password>
25+
<id>central</id>
26+
<username>${env.CENTRAL_USERNAME}</username>
27+
<password>${env.CENTRAL_TOKEN}</password>
2828
</server>
2929
<server>
30-
<id>bintray</id>
31-
<username>${env.BINTRAY_USER}</username>
32-
<password>${env.BINTRAY_KEY}</password>
33-
</server>
34-
<server>
35-
<id>jfrog-snapshots</id>
36-
<username>${env.BINTRAY_USER}</username>
37-
<password>${env.BINTRAY_KEY}</password>
30+
<id>github</id>
31+
<username>${env.GITHUB_ACTOR}</username>
32+
<password>${env.GITHUB_TOKEN}</password>
3833
</server>
3934
<server>
4035
<id>github.com</id>

‎pom.xml‎

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
<!-- spring-boot-starter-parent is a module of spring-boot-dependencies
9595
https://github.com/spring-projects/spring-boot/blob/master/spring-boot-starters/spring-boot-starter-parent/pom.xml -->
9696
<version.org.springframework.boot>2.2.0.RELEASE</version.org.springframework.boot>
97-
<version.org.springframework.cloud-spring-cloud-dependencies>Hoxton.SR1</version.org.springframework.cloud-spring-cloud-dependencies>
97+
<version.org.springframework.cloud-spring-cloud-dependencies>Hoxton.SR12</version.org.springframework.cloud-spring-cloud-dependencies>
9898
<version.org.awaitility-awaitility>4.3.0</version.org.awaitility-awaitility>
9999
<version.de.flapdoodle-embed.mongo>2.2.0</version.de.flapdoodle-embed.mongo>
100100
<version.cz.jirutka.spring-embedmongo-spring>1.3.1</version.cz.jirutka.spring-embedmongo-spring>
@@ -114,6 +114,7 @@
114114
<version.checkstyle>10.26.1</version.checkstyle>
115115
<version.io.takari-maven>0.7.7</version.io.takari-maven>
116116
<version.io.zikin.centralsync-maven-plugin>0.1.1</version.io.zikin.centralsync-maven-plugin>
117+
<version.maven-gpg-plugin>3.2.7</version.maven-gpg-plugin>
117118
</properties>
118119

119120
<dependencyManagement>
@@ -331,12 +332,12 @@
331332

332333
<distributionManagement>
333334
<repository>
334-
<id>bintray</id>
335-
<url>https://oss.jfrog.org/artifactory/oss-release-local</url>
335+
<id>central</id>
336+
<url>https://central.sonatype.com/repository/maven-releases/</url>
336337
</repository>
337338
<snapshotRepository>
338-
<id>jfrog-snapshots</id>
339-
<url>https://oss.jfrog.org/artifactory/oss-snapshot-local</url>
339+
<id>central</id>
340+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
340341
</snapshotRepository>
341342
</distributionManagement>
342343

@@ -404,7 +405,7 @@
404405
<useReleaseProfile>false</useReleaseProfile>
405406
<releaseProfiles>release</releaseProfiles>
406407
<autoVersionSubmodules>true</autoVersionSubmodules>
407-
<tagNameFormat>@{project.version}</tagNameFormat>
408+
<tagNameFormat>v@{project.version}</tagNameFormat>
408409
</configuration>
409410
</plugin>
410411
<plugin>
@@ -499,8 +500,42 @@
499500
</execution>
500501
</executions>
501502
</plugin>
503+
<!-- GPG signing for Maven Central -->
504+
<plugin>
505+
<groupId>org.apache.maven.plugins</groupId>
506+
<artifactId>maven-gpg-plugin</artifactId>
507+
<version>3.2.7</version>
508+
<executions>
509+
<execution>
510+
<id>sign-artifacts</id>
511+
<phase>verify</phase>
512+
<goals>
513+
<goal>sign</goal>
514+
</goals>
515+
<configuration>
516+
<gpgArguments>
517+
<arg>--pinentry-mode</arg>
518+
<arg>loopback</arg>
519+
</gpgArguments>
520+
</configuration>
521+
</execution>
522+
</executions>
523+
</plugin>
502524
</plugins>
503525
</build>
504526
</profile>
527+
<profile>
528+
<id>github</id>
529+
<distributionManagement>
530+
<repository>
531+
<id>github</id>
532+
<url>https://maven.pkg.github.com/opentracing-contrib/java-spring-cloud</url>
533+
</repository>
534+
<snapshotRepository>
535+
<id>github</id>
536+
<url>https://maven.pkg.github.com/opentracing-contrib/java-spring-cloud</url>
537+
</snapshotRepository>
538+
</distributionManagement>
539+
</profile>
505540
</profiles>
506541
</project>

0 commit comments

Comments
 (0)