Skip to content

Commit 307c1f1

Browse files
committed
Migrate release to Maven Central Portal
1 parent 671f208 commit 307c1f1

File tree

3 files changed

+49
-34
lines changed

3 files changed

+49
-34
lines changed

.github/actions/sync-to-maven-central/action.yml

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,44 +7,28 @@ inputs:
77
spring-retry-version:
88
description: 'The version of Spring Retry that is being synced to Central'
99
required: true
10-
ossrh-s01-token-username:
11-
description: 'Username for authentication with s01.oss.sonatype.org'
10+
central-token-username:
11+
description: 'Token name for authentication with the Central Portal'
1212
required: true
13-
ossrh-s01-token-password:
14-
description: 'Password for authentication with s01.oss.sonatype.org'
15-
required: true
16-
ossrh-s01-staging-profile:
17-
description: 'Staging profile to use when syncing to Central'
13+
central-token:
14+
description: 'Token for authentication with the Central Portal'
1815
required: true
16+
1917
runs:
2018
using: composite
2119
steps:
2220
- name: Set Up JFrog CLI
2321
uses: jfrog/setup-jfrog-cli@7c95feb32008765e1b4e626b078dfd897c4340ad # v4.1.2
2422
env:
2523
JF_ENV_SPRING: ${{ inputs.jfrog-cli-config-token }}
24+
2625
- name: Download Release Artifacts
2726
shell: bash
2827
run: jf rt download --spec ${{ format('{0}/artifacts.spec', github.action_path) }} --spec-vars 'buildName=${{ format('spring-retry-{0}', inputs.spring-retry-version) }};buildNumber=${{ github.run_number }}'
29-
- name: Sync
30-
uses: spring-io/nexus-sync-action@42477a2230a2f694f9eaa4643fa9e76b99b7ab84 # v0.0.1
28+
29+
- name: Deploy Bundle to Maven Central Portal
30+
uses: spring-io/central-publish-action@v0.3.0
3131
with:
32-
username: ${{ inputs.ossrh-s01-token-username }}
33-
password: ${{ inputs.ossrh-s01-token-password }}
34-
staging-profile-name: ${{ inputs.ossrh-s01-staging-profile }}
35-
create: true
36-
upload: true
37-
close: true
38-
release: true
39-
generate-checksums: true
40-
- name: Await
41-
shell: bash
42-
run: |
43-
url=${{ format('https://repo.maven.apache.org/maven2/org/springframework/retry/spring-retry/{0}/spring-retry-{0}.jar', inputs.spring-retry-version) }}
44-
echo "Waiting for $url"
45-
until curl --fail --head --silent $url > /dev/null
46-
do
47-
echo "."
48-
sleep 60
49-
done
50-
echo "$url is available"
32+
token-name: ${{ inputs.central-token-username }}
33+
token: ${{ inputs.central-token }}
34+
dir: central_bundle

.github/actions/sync-to-maven-central/artifacts.spec

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,45 @@
55
"items.find": {
66
"$and": [
77
{
8-
"@build.name": "${buildName}",
9-
"@build.number": "${buildNumber}"
8+
"@build.name": "${buildname}",
9+
"@build.number": "${buildnumber}",
10+
"path": {
11+
"$match": "org/springframework*"
12+
}
13+
},
14+
{
15+
"$or": [
16+
{
17+
"name": {
18+
"$match": "*.pom"
19+
}
20+
},
21+
{
22+
"name": {
23+
"$match": "*.jar"
24+
}
25+
},
26+
{
27+
"name": {
28+
"$match": "*.module"
29+
}
30+
},
31+
{
32+
"name": {
33+
"$match": "*.asc"
34+
}
35+
}
36+
]
37+
},
38+
{
39+
"name": {
40+
"$nmatch": "*.zip.asc"
41+
}
1042
}
1143
]
1244
}
1345
},
14-
"target": "nexus/"
46+
"target": "central_bundle/"
1547
}
1648
]
1749
}

.github/workflows/release.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,8 @@ jobs:
5050
uses: ./.github/actions/sync-to-maven-central
5151
with:
5252
jfrog-cli-config-token: ${{ secrets.JF_ARTIFACTORY_SPRING }}
53-
ossrh-s01-staging-profile: ${{ secrets.OSSRH_S01_STAGING_PROFILE }}
54-
ossrh-s01-token-password: ${{ secrets.OSSRH_S01_TOKEN_PASSWORD }}
55-
ossrh-s01-token-username: ${{ secrets.OSSRH_S01_TOKEN_USERNAME }}
53+
central-token-username: ${{ secrets.CENTRAL_TOKEN_USERNAME }}
54+
central-token: ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
5655
spring-retry-version: ${{ needs.build-and-stage-release.outputs.version }}
5756
promote-release:
5857
name: Promote Release

0 commit comments

Comments
 (0)