Skip to content

Commit c52c30e

Browse files
committed
Add Central Portal Deployment branch to respective WF
* Modify `spring-artifactory-deploy-to-maven-central.yml` to have `OSSRH_` secrets as optional * Add optional `PORTAL_` secrets to the `spring-artifactory-deploy-to-maven-central.yml` * Add `releaseVersion` input for the `spring-artifactory-deploy-to-maven-central.yml` required by the `actions/spring-publish-maven-central-portal` * Use more agnostic `central_bundle` directory name supported by both Nexus and Central Portal actions * Propagate `releaseVersion` input from the `spring-artifactory-gradle-release.yml` and `spring-artifactory-maven-release.yml` down to the `spring-artifactory-deploy-to-maven-central.yml`
1 parent 9866153 commit c52c30e

File tree

5 files changed

+29
-7
lines changed

5 files changed

+29
-7
lines changed

.github/actions/spring-publish-maven-central-portal/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ inputs:
1616
bundle-dir:
1717
description: 'A directory with release bundle'
1818
required: false
19-
default: 'nexus'
19+
default: 'central_bundle'
2020
generate-checksums:
2121
description: 'Whether to generate MD5 and SHA1 checksums. Might be already provided in bundle dir.'
2222
required: false

.github/workflows/spring-artifactory-deploy-to-maven-central.yml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ on:
1111
description: 'The Artifactory Build Number'
1212
required: true
1313
type: string
14+
releaseVersion:
15+
description: 'The release version'
16+
required: true
17+
type: string
1418
runner:
1519
description: 'The runner for job'
1620
required: false
@@ -19,16 +23,21 @@ on:
1923

2024
secrets:
2125
OSSRH_S01_TOKEN_USERNAME:
22-
required: true
26+
required: false
2327
OSSRH_S01_TOKEN_PASSWORD:
24-
required: true
28+
required: false
2529
OSSRH_STAGING_PROFILE_NAME:
26-
required: true
30+
required: false
31+
PORTAL_TOKEN_USERNAME:
32+
required: false
33+
PORTAL_TOKEN_PASSWORD:
34+
required: false
2735
JF_ARTIFACTORY_SPRING:
2836
required: true
2937

3038
env:
3139
JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }}
40+
OSSRH_S01_TOKEN_USERNAME: ${{ secrets.OSSRH_S01_TOKEN_USERNAME }}
3241
WORKFLOWS_REF: main
3342

3443
jobs:
@@ -57,10 +66,12 @@ jobs:
5766

5867
- uses: spring-io/[email protected]
5968
id: nexus
69+
if: env.OSSRH_S01_TOKEN_USERNAME
6070
with:
6171
username: ${{ secrets.OSSRH_S01_TOKEN_USERNAME }}
6272
password: ${{ secrets.OSSRH_S01_TOKEN_PASSWORD }}
6373
staging-profile-name: ${{ secrets.OSSRH_STAGING_PROFILE_NAME }}
74+
dir: central_bundle
6475
create: true
6576
upload: true
6677
generate-checksums: true
@@ -71,6 +82,16 @@ jobs:
7182
release-timeout: 3600
7283

7384
- name: Await for Artifact in Maven Central Repository
85+
if: env.OSSRH_S01_TOKEN_USERNAME
7486
uses: ./.github/actions/await-http-resource
7587
with:
76-
url: https://repo.maven.apache.org/maven2${{ steps.download-release-files.outputs.jarToCheck }}
88+
url: https://repo.maven.apache.org/maven2${{ steps.download-release-files.outputs.jarToCheck }}
89+
90+
- name: Deploy Bundle to Maven Central Portal
91+
if: env.PORTAL_TOKEN_USERNAME
92+
uses: ./.github/actions/spring-publish-maven-central-portal
93+
with:
94+
release-version: ${{ inputs.releaseVersion }}
95+
token-username: ${{ secrets.PORTAL_TOKEN_USERNAME }}
96+
token-password: ${{ secrets.PORTAL_TOKEN_PASSWORD }}
97+
deployment-status-interval: '1m'

.github/workflows/spring-artifactory-gradle-release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ jobs:
136136
with:
137137
buildName: ${{ needs.staging.outputs.buildName }}
138138
buildNumber: ${{ needs.staging.outputs.buildNumber }}
139+
releaseVersion: ${{ needs.releaseVersion.outputs.releaseVersion }}
139140
runner: ${{ inputs.runner }}
140141
secrets: inherit
141142

.github/workflows/spring-artifactory-maven-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ jobs:
136136
with:
137137
buildName: ${{ needs.staging.outputs.buildName }}
138138
buildNumber: ${{ needs.staging.outputs.buildNumber }}
139-
targetRepository: ${{ inputs.targetReleaseRepository }}
139+
releaseVersion: ${{ needs.releaseVersion.outputs.releaseVersion }}
140140
runner: ${{ inputs.runner }}
141141
secrets: inherit
142142

utils/release-files-spec.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
]
4444
}
4545
},
46-
"target": "nexus/"
46+
"target": "central_bundle/"
4747
}
4848
]
4949
}

0 commit comments

Comments
 (0)