Skip to content

Commit 7ad20a1

Browse files
committed
release: migrate to sonatype central
1 parent 1f490ee commit 7ad20a1

File tree

5 files changed

+113
-133
lines changed

5 files changed

+113
-133
lines changed

.github/workflows/release.yml

Lines changed: 89 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,20 @@ name: Release ScyllaDB Java Driver
33
on:
44
workflow_dispatch:
55
inputs:
6-
dryrun:
6+
dry-run:
77
type: boolean
8-
description: 'dryrun: run without pushing SCM changes to upstream'
9-
default: true
8+
description: 'dry-run: run without pushing SCM changes to upstream'
9+
default: false
10+
11+
skip-tests:
12+
type: boolean
13+
description: 'skip-tests: do not run tests while releasing'
14+
default: false
15+
16+
target-tag:
17+
type: string
18+
description: 'target-tag: tag or branch name to release. Use to to re-release failed releases'
19+
default: scylla-3.x
1020

1121
jobs:
1222
release:
@@ -20,44 +30,79 @@ jobs:
2030
MVNCMD: mvn -B -X -ntp
2131

2232
steps:
23-
- name: Checkout Repository
24-
uses: actions/checkout@v4
25-
26-
- name: Set up Java
27-
uses: actions/setup-java@v4
28-
with:
29-
java-version: '8'
30-
distribution: 'temurin'
31-
server-id: ossrh
32-
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
33-
server-username: OSSRH_USERNAME
34-
server-password: OSSRH_PASSWORD
35-
36-
- name: Configure Git user
37-
run: |
38-
git config user.name "ScyllaDB Promoter"
39-
git config user.email "[email protected]"
40-
41-
- name: Clean project
42-
run: $MVNCMD clean
43-
44-
- name: Clean release
45-
run: $MVNCMD release:clean
46-
47-
- name: Prepare release
48-
env:
49-
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
50-
run: $MVNCMD release:prepare -DpushChanges=false -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }}
51-
52-
- name: Perform release
53-
env:
54-
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
55-
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
56-
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
57-
run: $MVNCMD release:perform -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }}
58-
59-
- name: Push changes to SCM
60-
if: ${{ github.event.inputs.dryrun == 'false' }}
61-
run: |
62-
git status && git log -3
63-
git push origin --follow-tags -v
33+
- name: Checkout Repository
34+
uses: actions/checkout@v4
35+
36+
- name: Checkout Code One Commit Before ${{ inputs.target-tag }}
37+
if: inputs.target-tag != 'scylla-3.x'
38+
run: |
39+
git fetch --prune --unshallow || true
40+
git checkout ${{ inputs.target-tag }}~1
41+
git tag -d ${{ inputs.target-tag }}
42+
43+
- name: Set up Java
44+
uses: actions/setup-java@v4
45+
with:
46+
java-version: '11'
47+
distribution: 'temurin'
48+
server-id: central
49+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
50+
server-username: SONATYPE_TOKEN_USERNAME
51+
server-password: SONATYPE_TOKEN_PASSWORD
52+
53+
- name: Configure Git user
54+
run: |
55+
git config user.name "ScyllaDB Promoter"
56+
git config user.email "[email protected]"
57+
58+
- name: Clean project
59+
run: $MVNCMD clean
60+
61+
- name: Clean release
62+
run: $MVNCMD release:clean
63+
64+
- name: Prepare release
65+
env:
66+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
67+
run: |
68+
if [[ "${{ inputs.skip-tests }}" == "true" ]]; then
69+
MAVEN_OPTS="${MAVEN_OPTS} -DskipTests=true -DskipITs=true"
70+
fi
71+
export MAVEN_OPTS
72+
$MVNCMD release:prepare -DpushChanges=false -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }}
73+
74+
- name: Perform release
75+
env:
76+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
77+
SONATYPE_TOKEN_USERNAME: ${{ secrets.SONATYPE_TOKEN_USERNAME }}
78+
SONATYPE_TOKEN_PASSWORD: ${{ secrets.SONATYPE_TOKEN_PASSWORD }}
79+
run: |
80+
CMD_OPTS=""
81+
if [[ "${{ inputs.dry-run }}" != "true" ]]; then
82+
CMD_OPTS="-Drelease.autopublish=true"
83+
fi
84+
if [[ "${{ inputs.skip-tests }}" == "true" ]]; then
85+
MAVEN_OPTS="${MAVEN_OPTS} -DskipTests=true -DskipITs=true"
86+
fi
87+
export MAVEN_OPTS
88+
$MVNCMD release:perform $CMD_OPTS -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} > >(tee /tmp/logs-stdout.log) 2> >(tee /tmp/logs-stderr.log)
89+
90+
- name: Upload stdout.log
91+
if: failure()
92+
uses: actions/upload-artifact@v4
93+
with:
94+
name: maven-stdout
95+
path: /tmp/logs-stdout.log
96+
97+
- name: Upload stderr.log
98+
if: failure()
99+
uses: actions/upload-artifact@v4
100+
with:
101+
name: maven-stderr
102+
path: /tmp/logs-stderr.log
103+
104+
- name: Push changes to SCM
105+
if: ${{ inputs.dry-run == 'false' && inputs.target-tag == 'scylla-3.x' }}
106+
run: |
107+
git status && git log -3
108+
git push origin --follow-tags -v

driver-dist/pom.xml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,6 @@
5959
<finalName>scylla-java-driver-${project.version}</finalName>
6060

6161
<plugins>
62-
63-
<plugin>
64-
<artifactId>maven-jar-plugin</artifactId>
65-
<!-- http://stackoverflow.com/questions/13218313/unable-to-disable-generation-of-empty-jar-maven-jar-plugin -->
66-
<executions>
67-
<execution>
68-
<id>default-jar</id>
69-
<phase>none</phase>
70-
</execution>
71-
</executions>
72-
</plugin>
73-
7462
<plugin>
7563
<artifactId>maven-source-plugin</artifactId>
7664
<configuration>
@@ -144,13 +132,6 @@
144132
<tarLongFileMode>posix</tarLongFileMode>
145133
</configuration>
146134
</plugin>
147-
<plugin>
148-
<groupId>org.sonatype.plugins</groupId>
149-
<artifactId>nexus-staging-maven-plugin</artifactId>
150-
<configuration>
151-
<skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
152-
</configuration>
153-
</plugin>
154135
</plugins>
155136
</build>
156137
</profile>

driver-examples/pom.xml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -188,23 +188,4 @@
188188

189189
</build>
190190

191-
<profiles>
192-
193-
<profile>
194-
<id>release</id>
195-
<build>
196-
<plugins>
197-
<plugin>
198-
<groupId>org.sonatype.plugins</groupId>
199-
<artifactId>nexus-staging-maven-plugin</artifactId>
200-
<configuration>
201-
<skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
202-
</configuration>
203-
</plugin>
204-
</plugins>
205-
</build>
206-
</profile>
207-
208-
</profiles>
209-
210191
</project>

driver-tests/pom.xml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -91,23 +91,4 @@
9191

9292
</build>
9393

94-
<profiles>
95-
96-
<profile>
97-
<id>release</id>
98-
<build>
99-
<plugins>
100-
<plugin>
101-
<groupId>org.sonatype.plugins</groupId>
102-
<artifactId>nexus-staging-maven-plugin</artifactId>
103-
<configuration>
104-
<skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
105-
</configuration>
106-
</plugin>
107-
</plugins>
108-
</build>
109-
</profile>
110-
111-
</profiles>
112-
11394
</project>

pom.xml

Lines changed: 24 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@
102102
regular netty-tcnative.
103103
<os.detection.classifierWithLikes>fedora</os.detection.classifierWithLikes>
104104
-->
105+
<gpg.passphrase/>
106+
<release.autopublish>false</release.autopublish>
105107
</properties>
106108

107109
<dependencyManagement>
@@ -540,14 +542,15 @@
540542
<quiet>true</quiet>
541543
<verbose>false</verbose>
542544
<additionalparam>${javadoc.opts}</additionalparam>
545+
<detectJavaApiLink>true</detectJavaApiLink>
543546
<links>
544-
<link>https://docs.oracle.com/javase/8/docs/api/</link>
547+
<link>https://javadoc.io/doc/javax/javaee-api/8.0/</link>
545548
<link>https://google.github.io/guava/releases/19.0/api/docs/</link>
546549
<link>http://netty.io/4.0/api/</link>
547550
<link>http://www.joda.org/joda-time/apidocs/</link>
548551
<link>http://fasterxml.github.io/jackson-core/javadoc/2.8/</link>
549552
<link>http://fasterxml.github.io/jackson-databind/javadoc/2.7/</link>
550-
<link>https://javaee-spec.java.net/nonav/javadocs/</link>
553+
<link>https://jakarta.ee/specifications/platform/8/apidocs/</link>
551554
</links>
552555
<!-- optional dependencies from other modules (must be explicitly declared here in order to be correctly resolved) -->
553556
<additionalDependencies>
@@ -638,14 +641,15 @@
638641
<configuration>
639642
<tagNameFormat>@{project.version}</tagNameFormat>
640643
<autoVersionSubmodules>true</autoVersionSubmodules>
644+
<!-- <releaseProfiles>release</releaseProfiles>-->
645+
<!-- <useReleaseProfile>false</useReleaseProfile>-->
641646
<!-- useReleaseProfile>false</useReleaseProfile>
642647
<releaseProfiles>release</releaseProfiles>
643648
<goals>deploy</goals-->
644649
<localCheckout>true</localCheckout>
645-
<deployAtEnd>true</deployAtEnd>
646650
<pushChanges>${pushChanges}</pushChanges>
647651
<mavenExecutorId>forked-path</mavenExecutorId>
648-
<arguments>-Dgpg.passphrase=${gpg.passphrase}</arguments>
652+
<arguments>-Dgpg.passphrase=${gpg.passphrase} -Drelease.autopublish=${release.autopublish}</arguments>
649653
</configuration>
650654
<dependencies>
651655
<dependency>
@@ -839,18 +843,6 @@
839843
</executions>
840844
</plugin>
841845

842-
<plugin>
843-
<groupId>org.sonatype.plugins</groupId>
844-
<artifactId>nexus-staging-maven-plugin</artifactId>
845-
<version>1.6.8</version>
846-
<extensions>true</extensions>
847-
<configuration>
848-
<serverId>ossrh</serverId>
849-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
850-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
851-
</configuration>
852-
</plugin>
853-
854846
<plugin>
855847
<groupId>org.ops4j</groupId>
856848
<artifactId>maven-pax-plugin</artifactId>
@@ -903,7 +895,18 @@
903895
</execution>
904896
</executions>
905897
</plugin>
906-
898+
<plugin>
899+
<groupId>org.sonatype.central</groupId>
900+
<artifactId>central-publishing-maven-plugin</artifactId>
901+
<version>0.8.0</version>
902+
<extensions>true</extensions>
903+
<configuration>
904+
<publishingServerId>central</publishingServerId>
905+
<excludeArtifacts>scylla-driver-tests-parent,scylla-driver-dist,scylla-driver-examples</excludeArtifacts>
906+
<autoPublish>${release.autopublish}</autoPublish>
907+
<waitUntil>validated</waitUntil>
908+
</configuration>
909+
</plugin>
907910
</plugins>
908911

909912
</build>
@@ -1054,17 +1057,6 @@
10541057
</execution>
10551058
</executions>
10561059
</plugin>
1057-
<plugin>
1058-
<groupId>org.sonatype.plugins</groupId>
1059-
<artifactId>nexus-staging-maven-plugin</artifactId>
1060-
<extensions>true</extensions>
1061-
<configuration>
1062-
<serverId>ossrh</serverId>
1063-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
1064-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
1065-
<!-- skipLocalStaging>true</skipLocalStaging -->
1066-
</configuration>
1067-
</plugin>
10681060
</plugins>
10691061
</build>
10701062
</profile>
@@ -1130,12 +1122,12 @@
11301122

11311123
<distributionManagement>
11321124
<snapshotRepository>
1133-
<id>ossrh</id>
1134-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
1125+
<id>central</id>
1126+
<url>https://central.sonatype.com/repository/maven-snapshots</url>
11351127
</snapshotRepository>
11361128
<repository>
1137-
<id>ossrh</id>
1138-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
1129+
<id>central</id>
1130+
<url>https://central.sonatype.com/repository/maven-releases</url>
11391131
</repository>
11401132
</distributionManagement>
11411133

0 commit comments

Comments
 (0)