Skip to content

Commit d100e81

Browse files
Adds support for promoting to maven central (#78)
* Adds support for promoting to maven central
1 parent 38691ad commit d100e81

4 files changed

Lines changed: 78 additions & 1 deletion

File tree

pom.xml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@
2323
<url>https://github.com/spring-cloud/spring-cloud-bindings</url>
2424
</scm>
2525

26+
<developers>
27+
<developer>
28+
<id>scb-team</id>
29+
<name>Spring Cloud Bindings Team</name>
30+
<organizationUrl>https://github.com/spring-cloud/spring-cloud-bindings/graphs/contributors</organizationUrl>
31+
</developer>
32+
</developers>
33+
2634
<properties>
2735
<java.version>1.8</java.version>
2836
<jsr305.version>3.0.2</jsr305.version>
@@ -33,6 +41,8 @@
3341
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
3442
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
3543
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
44+
<maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
45+
<maven-javadoc-plugin.version>3.4.1</maven-javadoc-plugin.version>
3646

3747
<maven.compiler.source>${java.version}</maven.compiler.source>
3848
<maven.compiler.target>${java.version}</maven.compiler.target>
@@ -124,6 +134,39 @@
124134
</execution>
125135
</executions>
126136
</plugin>
137+
<plugin>
138+
<groupId>org.apache.maven.plugins</groupId>
139+
<artifactId>maven-javadoc-plugin</artifactId>
140+
<version>${maven-javadoc-plugin.version}</version>
141+
<executions>
142+
<execution>
143+
<id>attach-javadocs</id>
144+
<goals>
145+
<goal>jar</goal>
146+
</goals>
147+
</execution>
148+
</executions>
149+
</plugin>
150+
<plugin>
151+
<groupId>org.apache.maven.plugins</groupId>
152+
<artifactId>maven-gpg-plugin</artifactId>
153+
<version>${maven-gpg-plugin.version}</version>
154+
<executions>
155+
<execution>
156+
<id>sign-artifacts</id>
157+
<phase>verify</phase>
158+
<goals>
159+
<goal>sign</goal>
160+
</goals>
161+
<configuration>
162+
<gpgArguments>
163+
<arg>--pinentry-mode</arg>
164+
<arg>loopback</arg>
165+
</gpgArguments>
166+
</configuration>
167+
</execution>
168+
</executions>
169+
</plugin>
127170
<plugin>
128171
<groupId>org.apache.maven.plugins</groupId>
129172
<artifactId>maven-surefire-plugin</artifactId>

scripts/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
ARG base_image=ubuntu:bionic
22
FROM ${base_image}
33

4+
ADD https://repo.spring.io/libs-release/io/spring/concourse/releasescripts/concourse-release-scripts/0.3.2/concourse-release-scripts-0.3.2.jar /opt/concourse-release-scripts.jar
5+
46
RUN apt-get update && apt-get install --no-install-recommends -y \
5-
git \
7+
git gnupg \
68
&& rm -rf /var/lib/apt/lists/*

scripts/deploy.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,29 @@ set -euo pipefail
44

55
[[ -d "${PWD}"/maven && ! -d "${HOME}"/.m2 ]] && ln -s "${PWD}"/maven "${HOME}"/.m2
66

7+
function clean_gpg {
8+
FINGERPRINT=$(gpg --list-keys | head -4 | tail -1 | tr -d ' ')
9+
gpg --batch --yes --delete-secret-keys "$FINGERPRINT"
10+
gpg --batch --yes --delete-keys "$FINGERPRINT"
11+
}
12+
13+
trap clean_gpg EXIT
14+
gpg --batch --import-options import-show --import <(echo "$MAVEN_GPG_PRIVATE_KEY")
15+
16+
mkdir -p ~/.m2
17+
cat <<EOF > ~/.m2/settings.xml
18+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
19+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
21+
<servers>
22+
<server>
23+
<id>gpg.passphrase</id>
24+
<passphrase>${MAVEN_GPG_PASSPHRASE}</passphrase>
25+
</server>
26+
</servers>
27+
</settings>
28+
EOF
29+
730
REPOSITORY="${PWD}"/repository
831

932
cd source
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
export BUILD_INFO_LOCATION=$(pwd)/repository/build-info.json
6+
7+
java -jar /opt/concourse-release-scripts.jar publishToCentral 'RELEASE' "$BUILD_INFO_LOCATION" repository
8+
9+
echo "Sync complete"

0 commit comments

Comments
 (0)