Skip to content

Commit 8a5618a

Browse files
authored
Migrate from oss.sonatype.org to central.sonatype.org (#1599)
* Update maven publish logic * Update maven publish logic
1 parent 8ff792f commit 8a5618a

File tree

10 files changed

+83
-74
lines changed

10 files changed

+83
-74
lines changed

.github/workflows/benchmark.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ jobs:
1212
- uses: actions/checkout@v3
1313
- uses: actions/setup-node@v3
1414
with:
15-
node-version: "17.x"
15+
node-version: "20.x"
1616
- name: Set up JDK 1.17
17-
uses: actions/setup-java@v3
17+
uses: actions/setup-java@v4
1818
with:
19-
java-version: '17'
20-
distribution: 'adopt'
19+
java-version: 17
20+
java-package: jdk
21+
distribution: temurin
2122
cache: 'maven'
2223
- name: Install Modules
2324
run: mvn -B install --file pom.xml

.github/workflows/cve-scanning-node.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
node-version: [16.x]
15+
node-version: [20.x]
1616
steps:
1717
- uses: actions/checkout@v3
1818
- name: Use Node.js ${{ matrix.node-version }}

.github/workflows/cve-scanning.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
name: depecheck_test
1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v2
16+
uses: actions/checkout@v3
1717
- name: Build project with Maven
1818
run: mvn clean install
1919
- name: Depcheck

.github/workflows/legal-report-node.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
node-version: [18.x]
14+
node-version: [20.x]
1515
steps:
1616
- uses: actions/checkout@v3
1717
- name: Use Node.js ${{ matrix.node-version }}

.github/workflows/legal-report.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,12 @@ jobs:
3030
steps:
3131
- uses: actions/checkout@v3
3232
- name: Set up JDK 1.17
33-
uses: actions/setup-java@v1
33+
uses: actions/setup-java@v4
3434
with:
35-
java-version: 1.17
36-
cache: maven
35+
java-version: 17
36+
java-package: jdk
37+
distribution: temurin
38+
cache: 'maven'
3739
- name: Install XQ
3840
run: pip install xq
3941
- name: Build with Maven

.github/workflows/maven.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,20 @@ jobs:
77
runs-on: ubuntu-latest
88

99
steps:
10-
- uses: actions/checkout@v1
11-
- uses: actions/setup-node@v1
10+
- uses: actions/checkout@v3
11+
- uses: actions/setup-node@v3
1212
with:
13-
node-version: "18.x"
13+
node-version: "20.x"
1414
- name: Set up JDK 1.17
15-
uses: actions/setup-java@v1
15+
uses: actions/setup-java@v4
1616
with:
17-
java-version: 1.17
17+
java-version: 17
18+
java-package: jdk
19+
distribution: temurin
20+
cache: 'maven'
1821
- uses: actions/cache@v3
1922
with:
20-
path: ~/.m2/repository
23+
path: ${{ env.HOME }}/.m2/repository
2124
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
2225
restore-keys: |
2326
${{ runner.os }}-maven-

.github/workflows/publish-npm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
# Setup .npmrc file to publish to npm
1111
- uses: actions/setup-node@v3
1212
with:
13-
node-version: "16.x"
13+
node-version: "20.x"
1414
registry-url: "https://registry.npmjs.org"
1515
- run: cd ./vuu-ui && npm install
1616
- run: cd ./vuu-ui && npm run build
Lines changed: 38 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
name: Deploy to MVN Central
22

3+
env:
4+
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
5+
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
6+
CI_GPG_PASSPHRASE: ${{ secrets.CI_GPG_PASSPHRASE }}
7+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8+
39
on:
410
workflow_dispatch:
511
inputs:
@@ -17,45 +23,45 @@ jobs:
1723
runs-on: ubuntu-latest
1824

1925
steps:
20-
- name: Checkout Master
21-
uses: actions/checkout@v1
22-
# with:
23-
# path: master
26+
- name: Checkout source
27+
uses: actions/checkout@v3
28+
2429
- name: Switch to master
2530
run: git switch -c release-${{ github.event.inputs.releaseVersion }}
26-
- uses: actions/setup-node@v1
27-
with:
28-
node-version: "18.x"
29-
- name: Configure Git User
30-
run: |
31-
git config user.email "actions@github.com"
32-
git config user.name "GitHub Actions"
33-
- name: Set up JDK 1.17
34-
uses: actions/setup-java@v1
31+
32+
- name: Install Node
33+
uses: actions/setup-node@v3
3534
with:
36-
java-version: 1.17
37-
- uses: actions/cache@v3
35+
node-version: "20.x"
36+
37+
- name: Cache Maven dependencies
38+
uses: actions/cache@v4
3839
with:
39-
path: ~/.m2/repository
40+
path: ${{ env.HOME }}/.m2/repository
4041
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
4142
restore-keys: |
4243
${{ runner.os }}-maven-
43-
- name: Setup SSH Access for Commit
44-
uses: kielabokkie/ssh-key-and-known-hosts-action@v1.3.0
44+
45+
- name: Set up JDK
46+
uses: actions/setup-java@v4
4547
with:
46-
ssh-private-key: ${{ secrets.COMMIT_SSH_PRIVATE_KEY }}
47-
ssh-host: github.com
48-
- id: install-gpg-cert
49-
name: Install GPG secret key
48+
java-version: 17
49+
java-package: jdk
50+
distribution: temurin
51+
cache: 'maven'
52+
server-id: ossrh
53+
server-username: CI_DEPLOY_USERNAME
54+
server-password: CI_DEPLOY_PASSWORD
55+
gpg-private-key: ${{ secrets.CI_GPG_PRIVATE_KEY }}
56+
gpg-passphrase: CI_GPG_PASSPHRASE
57+
58+
- name: Configure git
5059
run: |
51-
cat <(echo -e "${{ secrets.GPG_PRIVATE_KEY }}") | gpg --batch --yes --always-trust --import
52-
# env:
53-
# GPG_TTY: $(tty)
60+
git config --global committer.email "infra@finos.org"
61+
git config --global committer.name "FINOS Admin"
62+
git config --global author.email "${GITHUB_ACTOR}@users.noreply.github.com"
63+
git config --global author.name "${GITHUB_ACTOR}"
64+
5465
- name: Build with Maven
55-
run: mvn --no-transfer-progress release:prepare release:perform -P sign-it -Dsign=true -Darguments=-Dgpg.passphrase=$MAVEN_GPG_PASSPHRASE -Dgpg.passphrase=$MAVEN_GPG_PASSPHRASE -s .settings/settings.xml -DreleaseVersion=${{ github.event.inputs.releaseVersion }} -DdevelopmentVersion=${{ github.event.inputs.developmentVersion }}
56-
env:
57-
# GPG_TTY: $(tty)
58-
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
59-
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
60-
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHASE }}
61-
COMMIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66+
run: mvn --no-transfer-progress release:prepare release:perform -P sign-it -Dsign=true -s .settings/settings.xml -DreleaseVersion=${{ github.event.inputs.releaseVersion }} -DdevelopmentVersion=${{ github.event.inputs.developmentVersion }}
67+

.settings/settings.xml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
<settings>
22
<servers>
3-
<!--server>
4-
<id>github</id>
5-
<privateKey>${user.home}/.ssh/id_dsa</privateKey>
6-
</server-->
73
<server>
84
<id>ossrh</id>
9-
<username>${env.OSSRH_USERNAME}</username>
10-
<password>${env.OSSRH_PASSWORD}</password>
5+
<username>${env.CI_DEPLOY_USERNAME}</username>
6+
<password>${env.CI_DEPLOY_PASSWORD}</password>
117
</server>
128
</servers>
139
</settings>

pom.xml

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,6 @@
7070
</dependencies>
7171
</dependencyManagement>
7272

73-
<distributionManagement>
74-
<snapshotRepository>
75-
<id>ossrh</id>
76-
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
77-
</snapshotRepository>
78-
<repository>
79-
<id>ossrh</id>
80-
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
81-
</repository>
82-
</distributionManagement>
83-
8473
<properties>
8574
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
8675
<maven.compiler.source>11</maven.compiler.source>
@@ -103,6 +92,11 @@
10392
<jmh.version>1.36</jmh.version>
10493
<guava.version>32.0.1-jre</guava.version>
10594
<maven.gpg.plugin.version>3.1.0</maven.gpg.plugin.version>
95+
<gpg.executable>gpg</gpg.executable>
96+
<publish.server.id>ossrh</publish.server.id>
97+
<release.goals>install org.sonatype.central:central-publishing-maven-plugin:0.7.0:publish</release.goals>
98+
<github.global.server>github</github.global.server>
99+
<github.oauth.token>${env.GITHUB_TOKEN}</github.oauth.token>
106100
</properties>
107101

108102
<modules>
@@ -246,6 +240,7 @@
246240
<gpgArguments>
247241
<arg>--pinentry-mode</arg>
248242
<arg>loopback</arg>
243+
<arg>--digest-algo=SHA512</arg>
249244
</gpgArguments>
250245
</configuration>
251246
</execution>
@@ -287,20 +282,26 @@
287282
<artifactId>maven-install-plugin</artifactId>
288283
<version>2.5.2</version>
289284
</plugin>
285+
290286
<plugin>
291-
<artifactId>maven-deploy-plugin</artifactId>
292-
<version>2.8.2</version>
287+
<groupId>org.apache.maven.plugins</groupId>
288+
<artifactId>maven-release-plugin</artifactId>
289+
<version>3.1.1</version>
290+
<configuration>
291+
<autoVersionSubmodules>true</autoVersionSubmodules>
292+
<releaseProfiles>release</releaseProfiles>
293+
<goals>${release.goals}</goals>
294+
</configuration>
293295
</plugin>
294296

295297
<plugin>
296-
<groupId>org.sonatype.plugins</groupId>
297-
<artifactId>nexus-staging-maven-plugin</artifactId>
298-
<version>1.6.13</version>
298+
<groupId>org.sonatype.central</groupId>
299+
<artifactId>central-publishing-maven-plugin</artifactId>
300+
<version>0.7.0</version>
299301
<extensions>true</extensions>
300302
<configuration>
301-
<serverId>ossrh</serverId>
302-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
303-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
303+
<publishingServerId>${publish.server.id}</publishingServerId>
304+
<autoPublish>true</autoPublish>
304305
</configuration>
305306
</plugin>
306307

0 commit comments

Comments
 (0)