Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-deploy via Travis CI upon tagged commit to master #484

Merged
merged 11 commits into from
Oct 31, 2019
24 changes: 24 additions & 0 deletions .maven.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<settings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/SETTINGS/1.0.0" xsi:schemalocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<!-- Maven Central Deployment -->
<id>ossrh</id>
childish-sambino marked this conversation as resolved.
Show resolved Hide resolved
<username>${env.SONATYPE_USERNAME}</username>
<password>${env.SONATYPE_PASSWORD}</password>
</server>
</servers>

<profiles>
<profile>
<id>ossrh</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<gpg.executable>${env.GPG_EXECUTABLE}</gpg.executable>
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
</properties>
</profile>
</profiles>
</settings>
25 changes: 18 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
language: java
sudo: false
## export GPG details
before_install:
- wget https://github.com/sormuras/bach/raw/master/install-jdk.sh
wget https://github.com/sormuras/bach/raw/master/install-jdk.sh;
echo $GPG_SECRET_KEYS | base64 --decode | $GPG_EXECUTABLE --import &&
echo $GPG_OWNERTRUST | base64 --decode | $GPG_EXECUTABLE --import-ownertrust;
childish-sambino marked this conversation as resolved.
Show resolved Hide resolved
matrix:
include:
# OpenJDK
Expand Down Expand Up @@ -35,10 +38,18 @@ notifications:
rooms:
- secure: MkRPjhMDkLMT0tKhSzSAEEdLxKlFrcEw00FBgpcpIl50kSpe3gxCJsm2bz5+LySblCfY1nI5D1+R++eB5cxJzgZvEBWIXQnGJVAV+X7WW1CI1FBZlv6FNLBe5gVPPzo5kIIM1g3o7AaERcraHK9h9S9N8cpnBRHe+Xf6wTRqmwo=
- secure: iRd6XcgHGFSJ/eS1ZwCUgUVTK0a+JAPmyPEx/OdFbma6DvF8WBhWtW5Q1dyrjQ3JWU8DW2Att9jRnGHd9F5wWWcykxYbD9DXrlfqCZpec9pHzEMAud9MG1PqK0d3y2oyjwps/fQ092PJcn9/y7zX6tzdVWKaKUe4iRDs1u1ehUo=
install:
mvn --settings .maven.xml install -DskipTests=true -Dgpg.skip -Dmaven.javadoc.skip=true -B -V;
childish-sambino marked this conversation as resolved.
Show resolved Hide resolved
deploy:
provider: script
script: make docker-build && make docker-push
skip_cleanup: true
on:
tags: true
jdk: openjdk8
- provider: script
script: make docker-build && make docker-push
skip_cleanup: true
on:
tags: true
jdk: openjdk8
- provider: script
script: mvn clean deploy --settings .maven.xml -DskipTests=true -B -U -Prelease
skip_cleanup: true
on:
tags: true
jdk: openjdk8
67 changes: 67 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,73 @@
</plugins>
</build>
</profile>

<profile>
<id>release</id>
<activation>
<property>
<name>release</name>
childish-sambino marked this conversation as resolved.
Show resolved Hide resolved
</property>
</activation>
<build>
<plugins>
<!-- To release to Maven central -->
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<extensions>true</extensions>
<configuration>
<serverid>ossrh</serverid>
<nexusurl>https://oss.sonatype.org/</nexusurl>
<autoreleaseafterclose>true</autoreleaseafterclose>
</configuration>
</plugin>
<!-- To generate javadoc -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- To sign the artifacts -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<properties>
Expand Down