Skip to content

Commit

Permalink
Update release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
fmbenhassine committed Dec 12, 2023
1 parent e7744ac commit 64188c7
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 59 deletions.
28 changes: 0 additions & 28 deletions .github/release-files-spec.json

This file was deleted.

79 changes: 48 additions & 31 deletions .github/workflows/maven-central-staging-43x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,64 @@ name: Maven Central Staging for 4.3.x
on:
workflow_dispatch:
inputs:
buildName:
description: "Artifactory build name"
required: true
buildNumber:
description: "Artifactory build number"
releaseVersion:
description: "Release version"
required: true

jobs:
build:
runs-on: ubuntu-latest
steps:

- name: Checkout source code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: '4.3.x'

# Setup jfrog cli
- uses: jfrog/setup-jfrog-cli@v1
with:
version: 1.43.2
env:
JF_ARTIFACTORY_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }}
- name: Capture release version
run: echo RELEASE_VERSION=${{ github.event.inputs.releaseVersion }} >> $GITHUB_ENV

# Extract build id from input
- name: Extract Build Id
- name: Prepare directory structure
run: |
echo JFROG_CLI_BUILD_NAME=${{ github.event.inputs.buildName }} >> $GITHUB_ENV
echo JFROG_CLI_BUILD_NUMBER=${{ github.event.inputs.buildNumber }} >> $GITHUB_ENV
mkdir -p nexus/org/springframework/batch/spring-batch-infrastructure/$RELEASE_VERSION
mkdir -p nexus/org/springframework/batch/spring-batch-core/$RELEASE_VERSION
mkdir -p nexus/org/springframework/batch/spring-batch-test/$RELEASE_VERSION
mkdir -p nexus/org/springframework/batch/spring-batch-integration/$RELEASE_VERSION
# Download released files
- name: Download Release Files
- name: Download release files from Artifactory
env:
ARTIFACTORY_URL: "https://repo.spring.io/libs-staging-local/org/springframework/batch"
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
run: |
jfrog rt download \
--spec .github/release-files-spec.json \
--spec-vars "buildname=$JFROG_CLI_BUILD_NAME;buildnumber=$JFROG_CLI_BUILD_NUMBER"
echo "Downloading infrastructure artifacts"
cd nexus/org/springframework/batch/spring-batch-infrastructure/$RELEASE_VERSION
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-batch-infrastructure/$RELEASE_VERSION/spring-batch-infrastructure-$RELEASE_VERSION.pom
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-batch-infrastructure/$RELEASE_VERSION/spring-batch-infrastructure-$RELEASE_VERSION.jar
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-batch-infrastructure/$RELEASE_VERSION/spring-batch-infrastructure-$RELEASE_VERSION-javadoc.jar
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-batch-infrastructure/$RELEASE_VERSION/spring-batch-infrastructure-$RELEASE_VERSION-sources.jar
echo "Downloading core artifacts"
cd ../../../../../..
cd nexus/org/springframework/batch/spring-batch-core/$RELEASE_VERSION
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-batch-core/$RELEASE_VERSION/spring-batch-core-$RELEASE_VERSION.pom
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-batch-core/$RELEASE_VERSION/spring-batch-core-$RELEASE_VERSION.jar
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-batch-core/$RELEASE_VERSION/spring-batch-core-$RELEASE_VERSION-javadoc.jar
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-batch-core/$RELEASE_VERSION/spring-batch-core-$RELEASE_VERSION-sources.jar
echo "Downloading test artifacts"
cd ../../../../../..
cd nexus/org/springframework/batch/spring-batch-test/$RELEASE_VERSION
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-batch-test/$RELEASE_VERSION/spring-batch-test-$RELEASE_VERSION.pom
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-batch-test/$RELEASE_VERSION/spring-batch-test-$RELEASE_VERSION.jar
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-batch-test/$RELEASE_VERSION/spring-batch-test-$RELEASE_VERSION-javadoc.jar
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-batch-test/$RELEASE_VERSION/spring-batch-test-$RELEASE_VERSION-sources.jar
# Create checksums, signatures and create staging repo on central and upload
- uses: jvalkeal/nexus-sync@v0
echo "Downloading integration artifacts"
cd ../../../../../..
cd nexus/org/springframework/batch/spring-batch-integration/$RELEASE_VERSION
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-batch-integration/$RELEASE_VERSION/spring-batch-integration-$RELEASE_VERSION.pom
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-batch-integration/$RELEASE_VERSION/spring-batch-integration-$RELEASE_VERSION.jar
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-batch-integration/$RELEASE_VERSION/spring-batch-integration-$RELEASE_VERSION-javadoc.jar
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-batch-integration/$RELEASE_VERSION/spring-batch-integration-$RELEASE_VERSION-sources.jar
- name: Sign artifacts and release them to Maven Central
uses: jvalkeal/nexus-sync@v0
id: nexus
with:
url: ${{ secrets.OSSRH_URL }}
Expand All @@ -50,11 +69,9 @@ jobs:
staging-profile-name: ${{ secrets.OSSRH_STAGING_PROFILE_NAME }}
create: true
upload: true
close: true
release: true
generate-checksums: true
pgp-sign: true
pgp-sign-passphrase: ${{ secrets.GPG_PASSPHRASE }}
pgp-sign-private-key: ${{ secrets.GPG_PRIVATE_KEY }}

# Print staging repo id
- name: Print Staging Repo Id
run: echo ${{ steps.nexus.outputs.staged-repository-id }}

0 comments on commit 64188c7

Please sign in to comment.