Skip to content

Commit 44b0bd4

Browse files
committed
Automate publication of gradle plugin
Closes gh-27079
1 parent 618c1e4 commit 44b0bd4

File tree

4 files changed

+49
-1
lines changed

4 files changed

+49
-1
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
plugins {
2+
id "com.gradle.plugin-publish" version "0.15.0"
3+
}
4+
tasks.register("publishExisting", com.gradle.publish.PublishExistingTask) {
5+
pluginId = "org.springframework.boot"
6+
fileRepositoryRoot = "${repositoryRoot}"
7+
pluginVersion = "${bootVersion}"
8+
pluginCoordinates = "org.springframework.boot:spring-boot-gradle-plugin:${bootVersion}"
9+
displayName = "Spring Boot Gradle Plugin"
10+
pluginDescription = "Spring Boot Gradle Plugin"
11+
website = "https://spring.io/projects/spring-boot"
12+
vcsUrl = "https://github.com/spring-projects/spring-boot"
13+
}

ci/pipeline.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ anchors:
7777
username: ((github-username))
7878
password: ((github-password))
7979
branch: main
80+
gradle-publish-params: &gradle-publish-params
81+
gradle_publish_key: ((gradle-publish-key))
82+
gradle_publish_secret: ((gradle-publish-secret))
8083
resource_types:
8184
- name: artifactory-resource
8285
type: registry-image
@@ -591,6 +594,21 @@ jobs:
591594
RELEASE_TYPE: RELEASE
592595
<<: *artifactory-task-params
593596
<<: *sonatype-task-params
597+
- name: publish-gradle-plugin
598+
serial: true
599+
plan:
600+
- get: ci-image
601+
- get: git-repo
602+
- get: artifactory-repo
603+
passed: [promote-release]
604+
params:
605+
download_artifacts: false
606+
save_build_info: true
607+
- task: publish-gradle-plugin
608+
image: ci-image
609+
file: git-repo/ci/tasks/publish-gradle-plugin.yml
610+
params:
611+
<<: *gradle-publish-params
594612
- name: create-github-release
595613
serial: true
596614
plan:
@@ -654,7 +672,7 @@ groups:
654672
- name: "builds"
655673
jobs: ["build", "jdk11-build", "jdk16-build", "windows-build"]
656674
- name: "releases"
657-
jobs: ["stage-milestone", "stage-rc", "stage-release", "promote-milestone", "promote-rc", "promote-release", "create-github-release", "publish-to-sdkman", "update-homebrew-tap"]
675+
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"]
658676
- name: "ci-images"
659677
jobs: ["build-ci-images", "detect-docker-updates", "detect-jdk-updates", "detect-ubuntu-image-updates"]
660678
- name: "pull-requests"

ci/scripts/publish-gradle-plugin.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
source $(dirname $0)/common.sh
4+
5+
version=$( cat artifactory-repo/build-info.json | jq -r '.buildInfo.modules[0].id' | sed 's/.*:.*:\(.*\)/\1/' )
6+
7+
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

ci/tasks/publish-gradle-plugin.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
platform: linux
3+
inputs:
4+
- name: artifactory-repo
5+
- name: git-repo
6+
params:
7+
GRADLE_PUBLISH_KEY:
8+
GRADLE_PUBLISH_SECRET:
9+
run:
10+
path: git-repo/ci/scripts/publish-gradle-plugin.sh

0 commit comments

Comments
 (0)