Add promote & Central GHA workflows

* Use an explicit `libs-snapshot-local` in the `ci-snapshot.yml` for JFrog CLI
* Add notices for `$JFROG_CLI_BUILD_NAME` & `$JFROG_CLI_BUILD_NUMBER` in the `release-staging.yml`
This commit is contained in:
Artem Bilan
2023-10-23 10:36:46 -04:00
parent 65dd738b53
commit 70a690ca90
4 changed files with 89 additions and 1 deletions

View File

@@ -40,7 +40,7 @@ jobs:
--server-id-resolve repo.spring.io \
--server-id-deploy repo.spring.io \
--repo-resolve snapshot \
--repo-deploy snapshot
--repo-deploy libs-snapshot-local
echo JFROG_CLI_BUILD_NAME=${{ github.event.repository.name }}-${{ github.ref_name }} >> $GITHUB_ENV
echo JFROG_CLI_BUILD_NUMBER=$GITHUB_RUN_NUMBER >> $GITHUB_ENV

View File

@@ -0,0 +1,56 @@
name: Promote Staged GA to Central
on:
workflow_dispatch:
inputs:
buildName:
description: 'The Artifactory Build Name'
required: true
buildNumber:
description: 'The Artifactory Build'
required: true
jobs:
staging:
runs-on: ubuntu-latest
if: github.repository_owner == 'spring-projects'
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
- uses: jfrog/setup-jfrog-cli@v3
with:
version: 2.50.2
env:
JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }}
- name: Promote Build
run: |
jfrog rt build-promote ${{ inputs.buildName }} ${{ inputs.buildNumber }} libs-release-local
# Download released files
- name: Download Release Files
run: |
jfrog rt download \
--spec .github/release-files-spec.json \
--spec-vars "buildname=${{ inputs.buildName }};buildnumber=${{ inputs.buildNumber }}"
# Create checksums, signatures and create staging repo on central and upload
- uses: jvalkeal/nexus-sync@v0.0.2
id: nexus
with:
url: ${{ secrets.OSSRH_URL }}
username: ${{ secrets.OSSRH_S01_TOKEN_USERNAME }}
password: ${{ secrets.OSSRH_S01_TOKEN_PASSWORD }}
staging-profile-name: ${{ secrets.OSSRH_STAGING_PROFILE_NAME }}
create: true
upload: true
generate-checksums: true
pgp-sign: true
upload-parallel: 10
pgp-sign-passphrase: ${{ secrets.GPG_PASSPHRASE }}
pgp-sign-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
close: true
release: true

27
.github/workflows/promote-milestone.yml vendored Normal file
View File

@@ -0,0 +1,27 @@
name: Promote Staged Milestone
on:
workflow_dispatch:
inputs:
buildName:
description: 'The Artifactory Build Name'
required: true
buildNumber:
description: 'The Artifactory Build'
required: true
jobs:
staging:
runs-on: ubuntu-latest
if: github.repository_owner == 'spring-projects'
steps:
- uses: jfrog/setup-jfrog-cli@v3
with:
version: 2.50.2
env:
JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }}
- name: Promote Build
run: |
jfrog rt build-promote ${{ inputs.buildName }} ${{ inputs.buildNumber }} libs-milestone-local

View File

@@ -68,3 +68,8 @@ jobs:
sed -i "s/version=.*/version=${{ inputs.nextDevelopmentVersion }}/" gradle.properties
git commit -a -m "[artifactory-release] Next development version"
git push origin
- name: Print Build Info
run: |
echo "::notice ::Artifactory Build Name=$JFROG_CLI_BUILD_NAME"
echo "::notice ::Artifactory Build Number=$JFROG_CLI_BUILD_NUMBER"