Skip to content

Commit

Permalink
support releases on tags; extract jacoco into deploy script
Browse files Browse the repository at this point in the history
Signed-off-by: Felix Neumann <dev@fxnn.de>
  • Loading branch information
fxnn committed Nov 1, 2018
1 parent 7d04931 commit 1f2f627
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 16 deletions.
25 changes: 20 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
language: java

jdk:
- oraclejdk8
install: mvn install -P !build-extras -DskipTests=true -Dmaven.javadoc.skip=true -B -V
script: mvn test -P !build-extras -B
after_success:
- mvn clean test jacoco:report coveralls:report -P record-coverage,!build-extras -B
- chmod +x src/main/build/mvndeploy.sh && ./src/main/build/mvndeploy.sh

script: mvn install --batch-mode --show-version

deploy:
- provider: script
script: bash src/main/build/mvndeploy.sh
skip_cleanup: true
on:
repo: fxnn/brainfuck
branch: master
- provider: script
script: bash src/main/build/mvndeploy.sh
skip_cleanup: true
on:
repo: fxnn/brainfuck
tags: true
- provider: script
script: bash src/main/build/jacoco-report.sh

cache:
directories:
- ~/.m2/repository
3 changes: 0 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,6 @@
</profile>
<profile>
<id>build-extras</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
Expand Down
4 changes: 4 additions & 0 deletions src/main/build/jacoco-report.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -e

mvn clean test jacoco:report coveralls:report -P record-coverage --batch-mode
27 changes: 19 additions & 8 deletions src/main/build/mvndeploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,24 @@
# based on http://www.debonair.io/post/maven-cd/

set -e

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"

if [ "$TRAVIS_BRANCH" = 'master' ] && [ "$TRAVIS_PULL_REQUEST" == 'false' ]; then
openssl aes-256-cbc \
-K $encrypted_8f8b80a3f07f_key -iv $encrypted_8f8b80a3f07f_iv \
-in $DIR/codesigning.asc.enc -out $DIR/codesigning.asc -d
gpg --fast-import $DIR/codesigning.asc
mvn deploy -P sign,build-extras --settings $DIR/mvnsettings.xml
fi
echo "Importing GPG key"
echo
openssl aes-256-cbc \
-K $encrypted_8f8b80a3f07f_key -iv $encrypted_8f8b80a3f07f_iv \
-in $DIR/codesigning.asc.enc -out $DIR/codesigning.asc -d
gpg --fast-import $DIR/codesigning.asc
echo

if [ "$TRAVIS_TAG" != "" ]; then
echo "Releasing version $TRAVIS_TAG"
echo
mvn versions:set -DnewVersion=$TRAVIS_TAG -DgenerateBackupPoms=false
echo
fi

echo "Deploying to repository"
echo
mvn deploy -P sign,build-extras --settings $DIR/mvnsettings.xml
echo

0 comments on commit 1f2f627

Please sign in to comment.