diff --git a/ci/config/gradle-plugin-publishing/build.gradle b/ci/config/gradle-plugin-publishing/build.gradle new file mode 100644 index 00000000000..bb02d3b5b01 --- /dev/null +++ b/ci/config/gradle-plugin-publishing/build.gradle @@ -0,0 +1,13 @@ +plugins { + id "com.gradle.plugin-publish" version "0.15.0" +} +tasks.register("publishExisting", com.gradle.publish.PublishExistingTask) { + pluginId = "org.springframework.boot" + fileRepositoryRoot = "${repositoryRoot}" + pluginVersion = "${bootVersion}" + pluginCoordinates = "org.springframework.boot:spring-boot-gradle-plugin:${bootVersion}" + displayName = "Spring Boot Gradle Plugin" + pluginDescription = "Spring Boot Gradle Plugin" + website = "https://spring.io/projects/spring-boot" + vcsUrl = "https://github.com/spring-projects/spring-boot" +} \ No newline at end of file diff --git a/ci/pipeline.yml b/ci/pipeline.yml index 3e1ad90559c..c83a76ac4ee 100644 --- a/ci/pipeline.yml +++ b/ci/pipeline.yml @@ -77,6 +77,9 @@ anchors: username: ((github-username)) password: ((github-password)) branch: main + gradle-publish-params: &gradle-publish-params + gradle_publish_key: ((gradle-publish-key)) + gradle_publish_secret: ((gradle-publish-secret)) resource_types: - name: artifactory-resource type: registry-image @@ -591,6 +594,21 @@ jobs: RELEASE_TYPE: RELEASE <<: *artifactory-task-params <<: *sonatype-task-params +- name: publish-gradle-plugin + serial: true + plan: + - get: ci-image + - get: git-repo + - get: artifactory-repo + passed: [promote-release] + params: + download_artifacts: false + save_build_info: true + - task: publish-gradle-plugin + image: ci-image + file: git-repo/ci/tasks/publish-gradle-plugin.yml + params: + <<: *gradle-publish-params - name: create-github-release serial: true plan: @@ -654,7 +672,7 @@ groups: - name: "builds" jobs: ["build", "jdk11-build", "jdk16-build", "windows-build"] - name: "releases" - jobs: ["stage-milestone", "stage-rc", "stage-release", "promote-milestone", "promote-rc", "promote-release", "create-github-release", "publish-to-sdkman", "update-homebrew-tap"] + jobs: ["stage-milestone", "stage-rc", "stage-release", "promote-milestone", "promote-rc", "promote-release", "create-github-release", "publish-gradle-plugin", "publish-to-sdkman", "update-homebrew-tap"] - name: "ci-images" jobs: ["build-ci-images", "detect-docker-updates", "detect-jdk-updates", "detect-ubuntu-image-updates"] - name: "pull-requests" diff --git a/ci/scripts/publish-gradle-plugin.sh b/ci/scripts/publish-gradle-plugin.sh new file mode 100755 index 00000000000..ca600398e60 --- /dev/null +++ b/ci/scripts/publish-gradle-plugin.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +source $(dirname $0)/common.sh + +version=$( cat artifactory-repo/build-info.json | jq -r '.buildInfo.modules[0].id' | sed 's/.*:.*:\(.*\)/\1/' ) + +git-repo/gradlew publishExisting -p git-repo/config/gradle-plugin-publishing -Pgradle.publish.key=${GRADLE_PUBLISH_KEY} -Pgradle.publish.secret=${GRADLE_PUBLISH_SECRET} -PbootVersion=${version} -PrepositoryRoot=$(pwd)/artifactory-repo diff --git a/ci/tasks/publish-gradle-plugin.yml b/ci/tasks/publish-gradle-plugin.yml new file mode 100644 index 00000000000..07430298b0e --- /dev/null +++ b/ci/tasks/publish-gradle-plugin.yml @@ -0,0 +1,10 @@ +--- +platform: linux +inputs: + - name: artifactory-repo + - name: git-repo +params: + GRADLE_PUBLISH_KEY: + GRADLE_PUBLISH_SECRET: +run: + path: git-repo/ci/scripts/publish-gradle-plugin.sh