Skip to content

Commit

Permalink
Added github config for travis build.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemmermann committed Sep 10, 2019
1 parent a036108 commit 625c7c5
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/.travis.settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<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 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>bintray-${env.BINTRAY_SUBJECT}-${env.BINTRAY_REPO}</id>
<username>${env.BINTRAY_USER}</username>
<password>${env.BINTRAY_API_KEY}</password>
</server>
</servers>
</settings>
15 changes: 15 additions & 0 deletions .github/deploy_bintray_central.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
echo "Copy settings.xml for deployment"
cp .github/.travis.settings.xml $HOME/.m2/settings.xml
echo "Deploy to Bintray"
mvn deploy -DskipTests
echo "Sync to Maven Central"
result=$(curl -X POST -u $BINTRAY_USER:$BINTRAY_API_KEY https://api.bintray.com/maven_central_sync/$BINTRAY_SUBJECT/$BINTRAY_REPO/$BINTRAY_PACKAGE/versions/$TRAVIS_TAG)
if [[ $result == *"Successfully synced and closed repo."* ]]
then
echo Successfully synced to Maven Central
exit 0
else
echo Failed sync to Maven Central: $result
exit 1
fi
47 changes: 47 additions & 0 deletions .github/deploy_prepare.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash

echo "Prepare Deployment"

# Script will zip the javadoc for upload to the release later, generate the changelog and increment the version in the pom.xml file to the one of the tag

echo TRAVIS_TAG=$TRAVIS_TAG
echo TAG_BRANCH=$TAG_BRANCH

rev=$(git rev-parse --short HEAD)

echo "Install Dependencies for Changelog Generation"
gem install activesupport -v 5.2.3
gem install github_changelog_generator -v 1.14.3
echo "Finished Install Dependencies for Changelog Generation"

git config user.name "Travis CI"
git config user.email "build@travis-ci.org"

echo "Prepare Git for Commits"
git remote add upstream "https://$GITHUB_TOKEN@github.com/$TRAVIS_REPO_SLUG.git"
git fetch upstream
git checkout $TAG_BRANCH
echo "Finished Prepare Git for Commits"

echo "Generate Changelog"
github_changelog_generator -t $GITHUB_TOKEN
git add -A CHANGELOG.md
git commit -m "update changelog at ${rev}"
echo "Finished Generate Changelog"

echo "Increment Version"
mvn versions:set -DnewVersion=$TRAVIS_TAG -DoldVersion=* -DgroupId=* -DartifactId=*
# increment version of children modules
mvn versions:update-child-modules
git commit -am "increment version to ${TRAVIS_TAG}"
echo "Finished Increment Version"

echo "Push commits"
git push upstream $TAG_BRANCH
echo "Finished Push commits"

echo "Running mvn package"
mvn package -DskipTests
echo "Making zip of javadoc"
cd ${TRAVIS_BUILD_DIR}/unitfx/target/apidocs
zip -r ${TRAVIS_BUILD_DIR}/javadoc.zip .

0 comments on commit 625c7c5

Please sign in to comment.