Skip to content

Commit b744f96

Browse files
committed
Maven Central Promotion Scripts
In an attempt to automate the promotion to Maven Central, this change adds scripts for the intermediate steps of promotion to Bintray and then promotion to Maven Central.
1 parent c283352 commit b744f96

File tree

4 files changed

+64
-0
lines changed

4 files changed

+64
-0
lines changed

ci/promote-to-bintray.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env sh
2+
3+
set -e
4+
5+
NAME=$(jq -r .name cf-java-client/target/build-info.json)
6+
NUMBER=$(jq -r .number cf-java-client/target/build-info.json)
7+
8+
## Promote to Bintray
9+
curl -X "POST" "https://repo.spring.io/api/build/distribute/$NAME/$NUMBER" \
10+
-H "Content-Type: application/json; charset=utf-8" \
11+
-u $ARTIFACTORY_USERNAME:$ARTIFACTORY_PASSWORD \
12+
-d $"{ \"sourceRepos\": [ \"$SOURCE_REPOSITORY\" ], \"targetRepo\": \"$TARGET_REPOSITORY\" }"

ci/promote-to-bintray.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
platform: linux
3+
4+
image_resource:
5+
type: docker-image
6+
source:
7+
repository: openjdk
8+
tag: 8-jdk-alpine
9+
10+
inputs:
11+
- name: cf-java-client
12+
13+
run:
14+
path: cf-java-client/ci/promote-to-bintray.sh
15+
16+
params:
17+
ARTIFACTORY_USERNAME:
18+
ARTIFACTORY_PASSWORD:
19+
SOURCE_REPOSITORY: libs-release-local
20+
TARGET_REPOSITORY: spring-distributions

ci/promote-to-maven-central.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env sh
2+
3+
set -e
4+
5+
GROUP_ID=$(jq -r .modules[0].id cf-java-client/target/build-info.json | cut -d ':' -f 1)
6+
VERSION=$(jq -r .modules[0].id cf-java-client/target/build-info.json | cut -d ':' -f 3)
7+
8+
## Promote to Maven Central
9+
curl -X "POST" "https://api.bintray.com/maven_central_sync/spring/jars/$GROUP_ID/versions/$VERSION" \
10+
-H "Content-Type: application/json; charset=utf-8" \
11+
-u $BINTRAY_USERNAME:$BINTRAY_API_KEY \
12+
-d $"{ \"username\": \"$MAVEN_CENTRAL_USERNAME\", \"password\": \"$MAVEN_CENTRAL_PASSWORD\" }"

ci/promote-to-maven-central.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
platform: linux
3+
4+
image_resource:
5+
type: docker-image
6+
source:
7+
repository: openjdk
8+
tag: 8-jdk-alpine
9+
10+
inputs:
11+
- name: cf-java-client
12+
13+
run:
14+
path: cf-java-client/ci/promote-to-maven-central.sh
15+
16+
params:
17+
BINTRAY_API_KEY:
18+
BINTRAY_USERNAME:
19+
MAVEN_CENTRAL_USERNAME:
20+
MAVEN_CENTRAL_PASSWORD:

0 commit comments

Comments
 (0)