Browse Source

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
pull/26658/head
Brian Clozel 5 years ago
parent
commit
ed71fe0460
  1. 11
      ci/config/release-scripts.yml
  2. 4
      ci/images/setup.sh
  3. 2
      ci/parameters.yml
  4. 23
      ci/pipeline.yml
  5. 3
      ci/scripts/generate-changelog.sh
  6. 6
      ci/scripts/promote-version.sh
  7. 4
      ci/tasks/generate-changelog.yml
  8. 8
      ci/tasks/promote-version.yml
  9. 16
      ci/tasks/sync-to-maven-central.yml

11
ci/config/release-scripts.yml

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

4
ci/images/setup.sh

@ -12,9 +12,9 @@ ln -fs /usr/share/zoneinfo/UTC /etc/localtime @@ -12,9 +12,9 @@ ln -fs /usr/share/zoneinfo/UTC /etc/localtime
dpkg-reconfigure --frontend noninteractive tzdata
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

2
ci/parameters.yml

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

23
ci/pipeline.yml

@ -3,11 +3,6 @@ anchors: @@ -3,11 +3,6 @@ anchors:
ARTIFACTORY_SERVER: ((artifactory-server))
ARTIFACTORY_USERNAME: ((artifactory-username))
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
username: ((docker-hub-username))
password: ((docker-hub-password))
@ -27,6 +22,8 @@ anchors: @@ -27,6 +22,8 @@ anchors:
sonatype-task-params: &sonatype-task-params
SONATYPE_USER_TOKEN: ((sonatype-user-token))
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
name: generated-changelog/tag
tag: generated-changelog/tag
@ -40,7 +37,7 @@ resource_types: @@ -40,7 +37,7 @@ resource_types:
type: registry-image
source:
repository: springio/artifactory-resource
tag: 0.0.12
tag: 0.0.13
- name: github-status-resource
type: registry-image
source:
@ -195,6 +192,8 @@ jobs: @@ -195,6 +192,8 @@ jobs:
params: { state: "success", commit: "git-repo" }
- put: artifactory-repo
params: &artifactory-params
signing_key: ((signing-key))
signing_passphrase: ((signing-passphrase))
repo: libs-snapshot-local
folder: distribution-repository
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: @@ -405,8 +404,8 @@ jobs:
params:
RELEASE_TYPE: RELEASE
<<: *artifactory-task-params
<<: *bintray-task-params
- name: sync-to-maven-central
<<: *sonatype-task-params
- name: create-github-release
serial: true
plan:
- get: spring-framework-ci-image
@ -417,12 +416,6 @@ jobs: @@ -417,12 +416,6 @@ jobs:
params:
download_artifacts: false
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
file: git-repo/ci/tasks/generate-changelog.yml
params:
@ -436,6 +429,6 @@ groups: @@ -436,6 +429,6 @@ groups:
- name: "builds"
jobs: ["build", "jdk11-build", "jdk15-build"]
- 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"
jobs: ["build-spring-framework-ci-images"]

3
ci/scripts/generate-changelog.sh

@ -2,7 +2,8 @@ @@ -2,7 +2,8 @@
set -e
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 \
--spring.config.location=${CONFIG_DIR}/changelog-generator.yml \

6
ci/scripts/promote-version.sh

@ -6,11 +6,13 @@ CONFIG_DIR=git-repo/ci/config @@ -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/' )
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 \
--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 $version > version/version

4
ci/tasks/generate-changelog.yml

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

8
ci/tasks/promote-version.yml

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

16
ci/tasks/sync-to-maven-central.yml

@ -1,16 +0,0 @@ @@ -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
Loading…
Cancel
Save