Adds support for promoting to maven central (#78)
* Adds support for promoting to maven central
This commit is contained in:
43
pom.xml
43
pom.xml
@@ -23,6 +23,14 @@
|
||||
<url>https://github.com/spring-cloud/spring-cloud-bindings</url>
|
||||
</scm>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<id>scb-team</id>
|
||||
<name>Spring Cloud Bindings Team</name>
|
||||
<organizationUrl>https://github.com/spring-cloud/spring-cloud-bindings/graphs/contributors</organizationUrl>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<jsr305.version>3.0.2</jsr305.version>
|
||||
@@ -33,6 +41,8 @@
|
||||
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
|
||||
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
|
||||
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
|
||||
<maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
|
||||
<maven-javadoc-plugin.version>3.4.1</maven-javadoc-plugin.version>
|
||||
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||
@@ -124,6 +134,39 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>${maven-javadoc-plugin.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-javadocs</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-gpg-plugin</artifactId>
|
||||
<version>${maven-gpg-plugin.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>sign-artifacts</id>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>sign</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<gpgArguments>
|
||||
<arg>--pinentry-mode</arg>
|
||||
<arg>loopback</arg>
|
||||
</gpgArguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
ARG base_image=ubuntu:bionic
|
||||
FROM ${base_image}
|
||||
|
||||
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
|
||||
|
||||
RUN apt-get update && apt-get install --no-install-recommends -y \
|
||||
git \
|
||||
git gnupg \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
@@ -4,6 +4,29 @@ set -euo pipefail
|
||||
|
||||
[[ -d "${PWD}"/maven && ! -d "${HOME}"/.m2 ]] && ln -s "${PWD}"/maven "${HOME}"/.m2
|
||||
|
||||
function clean_gpg {
|
||||
FINGERPRINT=$(gpg --list-keys | head -4 | tail -1 | tr -d ' ')
|
||||
gpg --batch --yes --delete-secret-keys "$FINGERPRINT"
|
||||
gpg --batch --yes --delete-keys "$FINGERPRINT"
|
||||
}
|
||||
|
||||
trap clean_gpg EXIT
|
||||
gpg --batch --import-options import-show --import <(echo "$MAVEN_GPG_PRIVATE_KEY")
|
||||
|
||||
mkdir -p ~/.m2
|
||||
cat <<EOF > ~/.m2/settings.xml
|
||||
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
|
||||
<servers>
|
||||
<server>
|
||||
<id>gpg.passphrase</id>
|
||||
<passphrase>${MAVEN_GPG_PASSPHRASE}</passphrase>
|
||||
</server>
|
||||
</servers>
|
||||
</settings>
|
||||
EOF
|
||||
|
||||
REPOSITORY="${PWD}"/repository
|
||||
|
||||
cd source
|
||||
|
||||
9
scripts/promote-to-maven-central.sh
Normal file
9
scripts/promote-to-maven-central.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
export BUILD_INFO_LOCATION=$(pwd)/repository/build-info.json
|
||||
|
||||
java -jar /opt/concourse-release-scripts.jar publishToCentral 'RELEASE' "$BUILD_INFO_LOCATION" repository
|
||||
|
||||
echo "Sync complete"
|
||||
Reference in New Issue
Block a user