diff --git a/.github/release-files-spec.json b/.github/release-files-spec.json deleted file mode 100644 index 222aed3678..0000000000 --- a/.github/release-files-spec.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "files": [ - { - "aql": { - "items.find": { - "$and": [ - { - "@build.name": "${buildname}", - "@build.number": "${buildnumber}", - "path": {"$match": "org/springframework/batch*"} - }, - { - "$or": [ - { - "name": {"$match": "*.pom"} - }, - { - "name": {"$match": "*.jar"} - } - ] - } - ] - } - }, - "target": "nexus/" - } - ] -} \ No newline at end of file diff --git a/.github/workflows/maven-central-staging-43x.yml b/.github/workflows/maven-central-staging-43x.yml index 326591ec96..4f85ac5ff0 100644 --- a/.github/workflows/maven-central-staging-43x.yml +++ b/.github/workflows/maven-central-staging-43x.yml @@ -3,11 +3,8 @@ 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: @@ -15,33 +12,55 @@ jobs: 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 }} @@ -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 }}