Skip to content

Commit 78c0d0b

Browse files
committed
release: migrate from oss to central portal
Sonatype support of oss ends in July 2025. We need to move to new API and plugins befor it happens.
1 parent eb7909a commit 78c0d0b

File tree

4 files changed

+86
-148
lines changed

4 files changed

+86
-148
lines changed

.github/workflows/release.yml

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ on:
88
description: 'dryrun: run without pushing SCM changes to upstream'
99
default: true
1010

11+
skip-tests:
12+
type: boolean
13+
description: 'skip-tests: do not run tests while releasing'
14+
default: true
15+
1116
jobs:
1217
release:
1318
name: Release
@@ -18,6 +23,7 @@ jobs:
1823

1924
env:
2025
MVNCMD: mvn -B -X -ntp
26+
MAVEN_OPTS: -Dorg.slf4j.simpleLogger.log.org.apache.http=WARN -Dorg.slf4j.simpleLogger.log.org.apache.http.wire=WARN
2127

2228
steps:
2329
- name: Checkout Repository
@@ -28,10 +34,10 @@ jobs:
2834
with:
2935
java-version: '11'
3036
distribution: 'temurin'
31-
server-id: ossrh
37+
server-id: central
3238
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
33-
server-username: OSSRH_USERNAME
34-
server-password: OSSRH_PASSWORD
39+
server-username: SONATYPE_TOKEN_USERNAME
40+
server-password: SONATYPE_TOKEN_PASSWORD
3541

3642
- name: Configure Git user
3743
run: |
@@ -47,15 +53,42 @@ jobs:
4753
- name: Prepare release
4854
env:
4955
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
50-
run: $MVNCMD release:prepare -DpushChanges=false -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }}
56+
run: |
57+
if [[ "${{ github.event.inputs.skip-tests }}" == "true" ]]; then
58+
MAVEN_OPTS="${MAVEN_OPTS} -DskipTests"
59+
fi
60+
export MAVEN_OPTS
61+
$MVNCMD release:prepare $ARGS -DpushChanges=false -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }}
5162
5263
- name: Perform release
5364
env:
5465
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
55-
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
56-
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
57-
if: ${{ github.event.inputs.dryrun == 'false' }}
58-
run: $MVNCMD release:perform -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }}
66+
SONATYPE_TOKEN_USERNAME: ${{ secrets.SONATYPE_TOKEN_USERNAME }}
67+
SONATYPE_TOKEN_PASSWORD: ${{ secrets.SONATYPE_TOKEN_PASSWORD }}
68+
run: |
69+
if [[ "${{ github.event.inputs.dryrun }}" == "true" ]]; then
70+
MAVEN_OPTS="${MAVEN_OPTS} -DdryRun=true"
71+
fi
72+
if [[ "${{ github.event.inputs.skip-tests }}" == "true" ]]; then
73+
MAVEN_OPTS="${MAVEN_OPTS} -DskipTests"
74+
fi
75+
MAVEN_OPTS="${MAVEN_OPTS} -pl '!scylla-cdc-printer,!scylla-cdc-driver3'"
76+
export MAVEN_OPTS
77+
$MVNCMD release:perform $ARGS -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} > >(tee /tmp/logs-stdout.log) 2> >(tee /tmp/logs-stderr.log)
78+
79+
- name: Upload stdout.log
80+
if: failure()
81+
uses: actions/upload-artifact@v4
82+
with:
83+
name: maven-stdout
84+
path: /tmp/logs-stdout.log
85+
86+
- name: Upload stderr.log
87+
if: failure()
88+
uses: actions/upload-artifact@v4
89+
with:
90+
name: maven-stderr
91+
path: /tmp/logs-stderr.log
5992

6093
- name: Push changes to SCM
6194
if: ${{ github.event.inputs.dryrun == 'false' }}

pom.xml

Lines changed: 44 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<maven.compiler.source>11</maven.compiler.source>
2222
<maven.compiler.target>11</maven.compiler.target>
2323
<flogger.version>0.8</flogger.version>
24+
<publish.dry.run>false</publish.dry.run>
2425
</properties>
2526

2627
<dependencyManagement>
@@ -78,7 +79,6 @@
7879
</plugin>
7980
<plugin>
8081
<artifactId>maven-release-plugin</artifactId>
81-
<version>2.5.3</version>
8282
<configuration>
8383
<tagNameFormat>scylla-cdc-@{project.version}</tagNameFormat>
8484
<autoVersionSubmodules>true</autoVersionSubmodules>
@@ -99,106 +99,47 @@
9999
</plugin>
100100
</plugins>
101101
</pluginManagement>
102+
<plugins>
103+
<plugin>
104+
<groupId>org.sonatype.central</groupId>
105+
<artifactId>central-publishing-maven-plugin</artifactId>
106+
<version>0.7.0</version>
107+
<extensions>true</extensions>
108+
<configuration>
109+
<publishingServerId>central</publishingServerId>
110+
<autoPublish>true</autoPublish>
111+
<skipPublishing>${publish.dry.run}</skipPublishing>
112+
<waitForPublishCompletion>true</waitForPublishCompletion>
113+
<waitUntil>validated</waitUntil>
114+
</configuration>
115+
</plugin>
116+
<plugin>
117+
<groupId>org.apache.maven.plugins</groupId>
118+
<artifactId>maven-surefire-plugin</artifactId>
119+
</plugin>
120+
<plugin>
121+
<groupId>org.apache.maven.plugins</groupId>
122+
<artifactId>maven-gpg-plugin</artifactId>
123+
<version>3.2.7</version>
124+
</plugin>
125+
<plugin>
126+
<groupId>org.apache.maven.plugins</groupId>
127+
<artifactId>maven-install-plugin</artifactId>
128+
<version>3.1.4</version>
129+
</plugin>
130+
<plugin>
131+
<groupId>org.apache.maven.plugins</groupId>
132+
<artifactId>maven-deploy-plugin</artifactId>
133+
<version>3.1.4</version>
134+
</plugin>
135+
<plugin>
136+
<groupId>org.apache.maven.plugins</groupId>
137+
<artifactId>maven-release-plugin</artifactId>
138+
<version>2.5.3</version>
139+
</plugin>
140+
</plugins>
102141
</build>
103142

104-
<!--
105-
Profile activated when releasing. See:
106-
http://central.sonatype.org/pages/apache-maven.html
107-
-->
108-
<profiles>
109-
<profile>
110-
<id>release-sign-artifacts</id>
111-
<activation>
112-
<property>
113-
<name>performRelease</name>
114-
<value>true</value>
115-
</property>
116-
</activation>
117-
<build>
118-
<plugins>
119-
<plugin>
120-
<groupId>org.apache.maven.plugins</groupId>
121-
<artifactId>maven-gpg-plugin</artifactId>
122-
<version>3.2.4</version>
123-
<executions>
124-
<execution>
125-
<id>sign-artifacts</id>
126-
<phase>verify</phase>
127-
<goals>
128-
<goal>sign</goal>
129-
</goals>
130-
</execution>
131-
</executions>
132-
</plugin>
133-
</plugins>
134-
</build>
135-
</profile>
136-
137-
<profile>
138-
<id>release</id>
139-
<build>
140-
<plugins>
141-
<plugin>
142-
<artifactId>maven-source-plugin</artifactId>
143-
<executions>
144-
<execution>
145-
<id>attach-sources</id>
146-
<goals>
147-
<goal>jar-no-fork</goal>
148-
</goals>
149-
</execution>
150-
</executions>
151-
</plugin>
152-
<!--
153-
TODO: re-enable when there are javadocs.
154-
<plugin>
155-
<artifactId>maven-javadoc-plugin</artifactId>
156-
<executions>
157-
<execution>
158-
<id>attach-javadocs</id>
159-
<goals>
160-
<goal>jar</goal>
161-
</goals>
162-
</execution>
163-
</executions>
164-
</plugin>
165-
-->
166-
<plugin>
167-
<groupId>org.apache.maven.plugins</groupId>
168-
<artifactId>maven-gpg-plugin</artifactId>
169-
<version>3.2.4</version>
170-
<executions>
171-
<execution>
172-
<id>sign-artifacts</id>
173-
<phase>verify</phase>
174-
<goals>
175-
<goal>sign</goal>
176-
</goals>
177-
<configuration>
178-
<gpgArguments>
179-
<arg>--pinentry-mode</arg>
180-
<arg>loopback</arg>
181-
</gpgArguments>
182-
</configuration>
183-
</execution>
184-
</executions>
185-
</plugin>
186-
<plugin>
187-
<groupId>org.sonatype.plugins</groupId>
188-
<artifactId>nexus-staging-maven-plugin</artifactId>
189-
<extensions>true</extensions>
190-
<configuration>
191-
<serverId>ossrh</serverId>
192-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
193-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
194-
<!-- skipLocalStaging>true</skipLocalStaging -->
195-
</configuration>
196-
</plugin>
197-
</plugins>
198-
</build>
199-
</profile>
200-
</profiles>
201-
202143
<scm>
203144
<connection>scm:git:https://github.com/scylladb/scylla-cdc-java</connection>
204145
<developerConnection>scm:git:https://github.com/scylladb/scylla-cdc-java</developerConnection>
@@ -217,12 +158,12 @@
217158

218159
<distributionManagement>
219160
<snapshotRepository>
220-
<id>ossrh</id>
221-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
161+
<id>central</id>
162+
<url>https://central.sonatype.com/repository/maven-snapshots</url>
222163
</snapshotRepository>
223164
<repository>
224-
<id>ossrh</id>
225-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
165+
<id>central</id>
166+
<url>https://central.sonatype.com/repository/maven-releases</url>
226167
</repository>
227168
</distributionManagement>
228169

scylla-cdc-printer/pom.xml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,45 +13,26 @@
1313
<plugins>
1414
<plugin>
1515
<artifactId>maven-gpg-plugin</artifactId>
16-
<version>3.2.4</version>
1716
<configuration>
1817
<skip>true</skip>
1918
</configuration>
2019
</plugin>
2120

2221
<plugin>
2322
<artifactId>maven-install-plugin</artifactId>
24-
<version>2.4</version>
2523
<configuration>
2624
<skip>true</skip>
2725
</configuration>
2826
</plugin>
2927

3028
<plugin>
3129
<artifactId>maven-deploy-plugin</artifactId>
32-
<version>2.7</version>
3330
<configuration>
3431
<skip>true</skip>
3532
</configuration>
3633
</plugin>
3734
</plugins>
3835
</build>
39-
<profiles>
40-
<profile>
41-
<id>release</id>
42-
<build>
43-
<plugins>
44-
<plugin>
45-
<groupId>org.sonatype.plugins</groupId>
46-
<artifactId>nexus-staging-maven-plugin</artifactId>
47-
<configuration>
48-
<skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
49-
</configuration>
50-
</plugin>
51-
</plugins>
52-
</build>
53-
</profile>
54-
</profiles>
5536
<dependencies>
5637
<dependency>
5738
<groupId>com.scylladb</groupId>

scylla-cdc-replicator/pom.xml

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,25 +44,23 @@
4444
</execution>
4545
</executions>
4646
</plugin>
47+
4748
<plugin>
4849
<artifactId>maven-gpg-plugin</artifactId>
49-
<version>3.2.4</version>
5050
<configuration>
5151
<skip>true</skip>
5252
</configuration>
5353
</plugin>
5454

5555
<plugin>
5656
<artifactId>maven-install-plugin</artifactId>
57-
<version>3.1.4</version>
5857
<configuration>
5958
<skip>true</skip>
6059
</configuration>
6160
</plugin>
6261

6362
<plugin>
6463
<artifactId>maven-deploy-plugin</artifactId>
65-
<version>3.1.4</version>
6664
<configuration>
6765
<skip>true</skip>
6866
</configuration>
@@ -156,21 +154,6 @@
156154
</plugins>
157155
</build>
158156
<profiles>
159-
<profile>
160-
<id>release</id>
161-
<build>
162-
<plugins>
163-
<plugin>
164-
<groupId>org.sonatype.plugins</groupId>
165-
<artifactId>nexus-staging-maven-plugin</artifactId>
166-
<configuration>
167-
<skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
168-
</configuration>
169-
</plugin>
170-
</plugins>
171-
</build>
172-
</profile>
173-
174157
<profile>
175158
<id>skip-integration-tests</id>
176159
<activation>

0 commit comments

Comments
 (0)