Skip to content

Commit 9c0a5ad

Browse files
committed
Migrate to the Central Publisher Portal, enable snapshot publishing
1 parent 40a470b commit 9c0a5ad

File tree

4 files changed

+46
-11
lines changed

4 files changed

+46
-11
lines changed

.github/workflows/main.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,29 @@ jobs:
6363
env:
6464
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6565
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
66+
67+
snapshot:
68+
69+
name: Publish Snapshot
70+
needs: [test, javadoc]
71+
runs-on: ubuntu-latest
72+
if: github.repository_owner == 'assertj' && github.event_name == 'push' && github.ref == 'refs/heads/main'
73+
74+
steps:
75+
- uses: actions/checkout@v4
76+
- name: Set up Maven Central
77+
uses: actions/setup-java@v4
78+
with:
79+
distribution: 'zulu'
80+
java-version: '21'
81+
server-id: central
82+
server-username: MAVEN_CENTRAL_USERNAME
83+
server-password: MAVEN_CENTRAL_TOKEN
84+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
85+
86+
- name: Publish to Maven Central
87+
run: ./mvnw $MAVEN_ARGS -DskipTests -Ppublish deploy
88+
env:
89+
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
90+
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
91+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ jobs:
2020
distribution: 'zulu'
2121
java-version: '21'
2222
server-id: ossrh
23-
server-username: OSSRH_USERNAME
24-
server-password: OSSRH_TOKEN
23+
server-username: MAVEN_CENTRAL_USERNAME
24+
server-password: MAVEN_CENTRAL_TOKEN
2525
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
2626

2727
- name: Publish to Maven Central
@@ -30,6 +30,6 @@ jobs:
3030
git config user.email '${{ github.actor }}@users.noreply.github.com'
3131
./mvnw $MAVEN_ARGS release:prepare release:perform -Dpassword=${{ secrets.GITHUB_TOKEN }}
3232
env:
33-
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
34-
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
33+
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
34+
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
3535
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

assertj-generator/pom.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.assertj</groupId>
77
<artifactId>assertj-generator-build</artifactId>
8-
<version>3.0.0-M6-SNAPSHOT</version>
8+
<version>3.0.0-SNAPSHOT</version>
99
</parent>
1010

1111
<artifactId>assertj-generator</artifactId>
@@ -17,8 +17,6 @@
1717
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1818
<!-- Needed to properly bring in the Maven dependencies, see http://maven.apache.org/surefire/maven-surefire-plugin/examples/class-loading.html -->
1919
<surefire.useSystemClassLoader>false</surefire.useSystemClassLoader>
20-
<!-- Dependency versions overriding -->
21-
<junit-jupiter.version>5.11.1</junit-jupiter.version>
2220
</properties>
2321

2422
<dependencyManagement>

pom.xml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
<parent>
66
<groupId>org.assertj</groupId>
77
<artifactId>assertj-parent</artifactId>
8-
<version>3.27.3</version>
8+
<version>3.27.4-SNAPSHOT</version> <!-- FIXME use 3.27.4 once released -->
99
</parent>
1010

1111
<artifactId>assertj-generator-build</artifactId>
12-
<version>3.0.0-M6-SNAPSHOT</version>
12+
<version>3.0.0-SNAPSHOT</version>
1313
<packaging>pom</packaging>
1414

1515
<name>AssertJ Generator Build</name>
@@ -32,9 +32,20 @@
3232
<build>
3333
<plugins>
3434
<plugin>
35-
<groupId>org.sonatype.plugins</groupId>
36-
<artifactId>nexus-staging-maven-plugin</artifactId>
35+
<groupId>org.sonatype.central</groupId>
36+
<artifactId>central-publishing-maven-plugin</artifactId>
3737
</plugin>
3838
</plugins>
3939
</build>
40+
41+
<!-- FIXME delete once 3.27.4 is released -->
42+
<repositories>
43+
<repository>
44+
<id>central-portal-snapshots</id>
45+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
46+
<releases>
47+
<enabled>false</enabled>
48+
</releases>
49+
</repository>
50+
</repositories>
4051
</project>

0 commit comments

Comments
 (0)