Publish directly to Maven Central

This commit skips the Bintray-related tasks in our CI pipeline and
instead relies on Maven Central for publishing Spring Framework
artifacts.

This commit also updates the CI pipeline to sign the artifacts directly
with the `artifactory-resource`.

Closes gh-26654
This commit is contained in:
Brian Clozel 2021-03-09 15:17:06 +01:00
parent 89f70bdc46
commit ed71fe0460
9 changed files with 29 additions and 50 deletions

View File

@ -1,9 +1,10 @@
logging:
level:
io.spring.concourse: DEBUG
distribute:
optional-deployments:
- '.*\.zip'
spring: spring:
main: main:
banner-mode: off banner-mode: off
logging:
level:
io.spring.concourse: DEBUG
sonatype:
exclude:
- 'build-info\.json'
- '.*\.zip'

View File

@ -12,9 +12,9 @@ ln -fs /usr/share/zoneinfo/UTC /etc/localtime
dpkg-reconfigure --frontend noninteractive tzdata dpkg-reconfigure --frontend noninteractive tzdata
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
curl https://raw.githubusercontent.com/spring-io/concourse-java-scripts/v0.0.3/concourse-java.sh > /opt/concourse-java.sh curl https://raw.githubusercontent.com/spring-io/concourse-java-scripts/v0.0.4/concourse-java.sh > /opt/concourse-java.sh
curl --output /opt/concourse-release-scripts.jar https://repo.spring.io/release/io/spring/concourse/releasescripts/concourse-release-scripts/0.2.1/concourse-release-scripts-0.2.1.jar curl --output /opt/concourse-release-scripts.jar https://repo.spring.io/release/io/spring/concourse/releasescripts/concourse-release-scripts/0.3.0/concourse-release-scripts-0.3.0.jar
########################################################### ###########################################################
# JAVA # JAVA

View File

@ -9,6 +9,4 @@ branch: "master"
build-name: "spring-framework" build-name: "spring-framework"
pipeline-name: "spring-framework" pipeline-name: "spring-framework"
concourse-url: "https://ci.spring.io" concourse-url: "https://ci.spring.io"
bintray-subject: "spring"
bintray-repo: "jars"
task-timeout: 1h00m task-timeout: 1h00m

View File

@ -3,11 +3,6 @@ anchors:
ARTIFACTORY_SERVER: ((artifactory-server)) ARTIFACTORY_SERVER: ((artifactory-server))
ARTIFACTORY_USERNAME: ((artifactory-username)) ARTIFACTORY_USERNAME: ((artifactory-username))
ARTIFACTORY_PASSWORD: ((artifactory-password)) ARTIFACTORY_PASSWORD: ((artifactory-password))
bintray-task-params: &bintray-task-params
BINTRAY_SUBJECT: ((bintray-subject))
BINTRAY_REPO: ((bintray-repo))
BINTRAY_USERNAME: ((bintray-username))
BINTRAY_API_KEY: ((bintray-api-key))
docker-resource-source: &docker-resource-source docker-resource-source: &docker-resource-source
username: ((docker-hub-username)) username: ((docker-hub-username))
password: ((docker-hub-password)) password: ((docker-hub-password))
@ -27,6 +22,8 @@ anchors:
sonatype-task-params: &sonatype-task-params sonatype-task-params: &sonatype-task-params
SONATYPE_USER_TOKEN: ((sonatype-user-token)) SONATYPE_USER_TOKEN: ((sonatype-user-token))
SONATYPE_PASSWORD_TOKEN: ((sonatype-user-token-password)) SONATYPE_PASSWORD_TOKEN: ((sonatype-user-token-password))
SONATYPE_URL: ((sonatype-url))
SONATYPE_STAGING_PROFILE_ID: ((sonatype-staging-profile-id))
changelog-task-params: &changelog-task-params changelog-task-params: &changelog-task-params
name: generated-changelog/tag name: generated-changelog/tag
tag: generated-changelog/tag tag: generated-changelog/tag
@ -40,7 +37,7 @@ resource_types:
type: registry-image type: registry-image
source: source:
repository: springio/artifactory-resource repository: springio/artifactory-resource
tag: 0.0.12 tag: 0.0.13
- name: github-status-resource - name: github-status-resource
type: registry-image type: registry-image
source: source:
@ -195,6 +192,8 @@ jobs:
params: { state: "success", commit: "git-repo" } params: { state: "success", commit: "git-repo" }
- put: artifactory-repo - put: artifactory-repo
params: &artifactory-params params: &artifactory-params
signing_key: ((signing-key))
signing_passphrase: ((signing-passphrase))
repo: libs-snapshot-local repo: libs-snapshot-local
folder: distribution-repository folder: distribution-repository
build_uri: "https://ci.spring.io/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}" build_uri: "https://ci.spring.io/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}"
@ -405,8 +404,8 @@ jobs:
params: params:
RELEASE_TYPE: RELEASE RELEASE_TYPE: RELEASE
<<: *artifactory-task-params <<: *artifactory-task-params
<<: *bintray-task-params <<: *sonatype-task-params
- name: sync-to-maven-central - name: create-github-release
serial: true serial: true
plan: plan:
- get: spring-framework-ci-image - get: spring-framework-ci-image
@ -417,12 +416,6 @@ jobs:
params: params:
download_artifacts: false download_artifacts: false
save_build_info: true save_build_info: true
- task: sync-to-maven-central
image: spring-framework-ci-image
file: git-repo/ci/tasks/sync-to-maven-central.yml
params:
<<: *bintray-task-params
<<: *sonatype-task-params
- task: generate-changelog - task: generate-changelog
file: git-repo/ci/tasks/generate-changelog.yml file: git-repo/ci/tasks/generate-changelog.yml
params: params:
@ -436,6 +429,6 @@ groups:
- name: "builds" - name: "builds"
jobs: ["build", "jdk11-build", "jdk15-build"] jobs: ["build", "jdk11-build", "jdk15-build"]
- name: "releases" - name: "releases"
jobs: ["stage-milestone", "stage-rc", "stage-release", "promote-milestone","promote-rc", "promote-release", "sync-to-maven-central"] jobs: ["stage-milestone", "stage-rc", "stage-release", "promote-milestone","promote-rc", "promote-release", "create-github-release"]
- name: "ci-images" - name: "ci-images"
jobs: ["build-spring-framework-ci-images"] jobs: ["build-spring-framework-ci-images"]

View File

@ -2,7 +2,8 @@
set -e set -e
CONFIG_DIR=git-repo/ci/config CONFIG_DIR=git-repo/ci/config
version=$( cat version/version ) version=$( cat artifactory-repo/build-info.json | jq -r '.buildInfo.modules[0].id' | sed 's/.*:.*:\(.*\)/\1/' )
java -jar /github-changelog-generator.jar \ java -jar /github-changelog-generator.jar \
--spring.config.location=${CONFIG_DIR}/changelog-generator.yml \ --spring.config.location=${CONFIG_DIR}/changelog-generator.yml \

View File

@ -6,11 +6,13 @@ CONFIG_DIR=git-repo/ci/config
version=$( cat artifactory-repo/build-info.json | jq -r '.buildInfo.modules[0].id' | sed 's/.*:.*:\(.*\)/\1/' ) version=$( cat artifactory-repo/build-info.json | jq -r '.buildInfo.modules[0].id' | sed 's/.*:.*:\(.*\)/\1/' )
export BUILD_INFO_LOCATION=$(pwd)/artifactory-repo/build-info.json export BUILD_INFO_LOCATION=$(pwd)/artifactory-repo/build-info.json
java -jar /opt/concourse-release-scripts.jar promote $RELEASE_TYPE $BUILD_INFO_LOCATION || { exit 1; } java -jar /opt/concourse-release-scripts.jar \
--spring.config.location=${CONFIG_DIR}/release-scripts.yml \
publishToCentral $RELEASE_TYPE $BUILD_INFO_LOCATION artifactory-repo || { exit 1; }
java -jar /opt/concourse-release-scripts.jar \ java -jar /opt/concourse-release-scripts.jar \
--spring.config.location=${CONFIG_DIR}/release-scripts.yml \ --spring.config.location=${CONFIG_DIR}/release-scripts.yml \
distribute $RELEASE_TYPE $BUILD_INFO_LOCATION || { exit 1; } promote $RELEASE_TYPE $BUILD_INFO_LOCATION || { exit 1; }
echo "Promotion complete" echo "Promotion complete"
echo $version > version/version echo $version > version/version

View File

@ -4,10 +4,10 @@ image_resource:
type: docker-image type: docker-image
source: source:
repository: springio/github-changelog-generator repository: springio/github-changelog-generator
tag: '0.0.4' tag: '0.0.6'
inputs: inputs:
- name: git-repo - name: git-repo
- name: version - name: artifactory-repo
outputs: outputs:
- name: generated-changelog - name: generated-changelog
params: params:

View File

@ -10,9 +10,9 @@ params:
ARTIFACTORY_SERVER: ARTIFACTORY_SERVER:
ARTIFACTORY_USERNAME: ARTIFACTORY_USERNAME:
ARTIFACTORY_PASSWORD: ARTIFACTORY_PASSWORD:
BINTRAY_SUBJECT: SONATYPE_USER_TOKEN:
BINTRAY_REPO: SONATYPE_PASSWORD_TOKEN:
BINTRAY_USERNAME: SONATYPE_URL:
BINTRAY_API_KEY: SONATYPE_STAGING_PROFILE_ID:
run: run:
path: git-repo/ci/scripts/promote-version.sh path: git-repo/ci/scripts/promote-version.sh

View File

@ -1,16 +0,0 @@
---
platform: linux
inputs:
- name: git-repo
- name: artifactory-repo
outputs:
- name: version
params:
BINTRAY_REPO:
BINTRAY_SUBJECT:
BINTRAY_USERNAME:
BINTRAY_API_KEY:
SONATYPE_USER_TOKEN:
SONATYPE_PASSWORD_TOKEN:
run:
path: git-repo/ci/scripts/sync-to-maven-central.sh