Skip to content

Commit

Permalink
Remove redundant OSSRH_URL secret
Browse files Browse the repository at this point in the history
  • Loading branch information
artembilan committed Aug 28, 2024
1 parent e199d14 commit c9bee8a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 17 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/spring-artifactory-gradle-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ on:
required: false
GH_ACTIONS_REPO_TOKEN:
required: true
OSSRH_URL:
required: false
OSSRH_S01_TOKEN_USERNAME:
required: false
OSSRH_S01_TOKEN_PASSWORD:
Expand Down Expand Up @@ -130,7 +128,7 @@ jobs:
needs: [releaseVersion, staging]
name: Promote ${{ needs.releaseVersion.outputs.releaseVersion }}
if: ${{ !contains(needs.releaseVersion.outputs.releaseVersion, '-') }}
uses: ./.github/workflows/spring-artifactory-promote-central.yml
uses: ./.github/workflows/spring-artifactory-promote-ga.yml
with:
buildName: ${{ needs.staging.outputs.buildName }}
buildNumber: ${{ needs.staging.outputs.buildNumber }}
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/spring-artifactory-maven-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ on:
required: false
GH_ACTIONS_REPO_TOKEN:
required: true
OSSRH_URL:
required: false
OSSRH_S01_TOKEN_USERNAME:
required: false
OSSRH_S01_TOKEN_PASSWORD:
Expand Down Expand Up @@ -128,7 +126,7 @@ jobs:
needs: [releaseVersion, staging, verify-staged]
name: Promote ${{ needs.releaseVersion.outputs.releaseVersion }}
if: ${{ !contains(needs.releaseVersion.outputs.releaseVersion, '-') }}
uses: ./.github/workflows/spring-artifactory-promote-central.yml
uses: ./.github/workflows/spring-artifactory-promote-ga.yml
with:
buildName: ${{ needs.staging.outputs.buildName }}
buildNumber: ${{ needs.staging.outputs.buildNumber }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Promote Staged GA release from Artifactory to Maven Central
name: Promote Staged GA release (optional to Maven Central)

on:
workflow_call:
Expand Down Expand Up @@ -27,8 +27,6 @@ on:
default: ubuntu-latest

secrets:
OSSRH_URL:
required: false
OSSRH_S01_TOKEN_USERNAME:
required: false
OSSRH_S01_TOKEN_PASSWORD:
Expand All @@ -40,11 +38,11 @@ on:

env:
JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }}
OSSRH_URL: ${{ secrets.OSSRH_URL }}
OSSRH_STAGING_PROFILE_NAME: ${{ secrets.OSSRH_STAGING_PROFILE_NAME }}
WORKFLOWS_REF: main

jobs:
release-to-central:
promote-ga:
runs-on: ${{ inputs.runner }}
steps:

Expand All @@ -60,17 +58,16 @@ jobs:
run: jfrog rt build-promote ${{ inputs.buildName }} ${{ inputs.buildNumber }} ${{ inputs.targetRepository }} --project=${{ inputs.artifactoryProjectKey }}

- name: Download Release Files
if: env.OSSRH_URL
if: env.OSSRH_STAGING_PROFILE_NAME
run: |
jfrog rt download \
--spec utils/release-files-spec.json \
--spec-vars "buildname=${{ inputs.buildName }};buildnumber=${{ inputs.buildNumber }}"
- uses: spring-io/[email protected]
id: nexus
if: env.OSSRH_URL
if: env.OSSRH_STAGING_PROFILE_NAME
with:
url: ${{ env.OSSRH_URL }}
username: ${{ secrets.OSSRH_S01_TOKEN_USERNAME }}
password: ${{ secrets.OSSRH_S01_TOKEN_PASSWORD }}
staging-profile-name: ${{ secrets.OSSRH_STAGING_PROFILE_NAME }}
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ JF_ARTIFACTORY_SPRING
ARTIFACTORY_USERNAME
ARTIFACTORY_PASSWORD
SPRING_RELEASE_CHAT_WEBHOOK_URL
OSSRH_URL
OSSRH_S01_TOKEN_USERNAME
OSSRH_S01_TOKEN_PASSWORD
OSSRH_STAGING_PROFILE_NAME
Expand Down Expand Up @@ -215,7 +214,7 @@ The workflow reacts to non-empty `due_on` property of the event's milestone payl
The `next-dev-version-init.gradle` script adds a `nextDevelopmentVersion` task which is used when release has been staged and job is ready to push `Next development version` commit.
The `spring-artifactory-init.gradle` script adds the `org.jfrog.gradle.plugin.artifactory.ArtifactoryPlugin` and `signing` plugins.
Configures them for those projects where the `maven-publish` plugin is applied.
The `signing` is activated if no `OSSRH_URL` environment variable is present, but `GPG_PASSPHRASE` & `GPG_PRIVATE_KEY` are present.
The `signing` is activated if no `OSSRH_STAGING_PROFILE_NAME` environment variable is present, but `GPG_PASSPHRASE` & `GPG_PRIVATE_KEY` are present.
The Artifactory plugin requires these environment variables:

```
Expand Down
1 change: 0 additions & 1 deletion samples/release-with-gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ jobs:
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
SPRING_RELEASE_SLACK_WEBHOOK_URL: ${{ secrets.SPRING_RELEASE_SLACK_WEBHOOK_URL }}
OSSRH_URL: ${{ secrets.OSSRH_URL }}
OSSRH_S01_TOKEN_USERNAME: ${{ secrets.OSSRH_S01_TOKEN_USERNAME }}
OSSRH_S01_TOKEN_PASSWORD: ${{ secrets.OSSRH_S01_TOKEN_PASSWORD }}
OSSRH_STAGING_PROFILE_NAME: ${{ secrets.OSSRH_STAGING_PROFILE_NAME }}
Expand Down

0 comments on commit c9bee8a

Please sign in to comment.