diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..506e3595 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,29 @@ +language: java +sudo: false +env: + - GPG_EXECUTABLE=gpg2 +before_install: + - if [ ! -z "$GPG_SECRET_KEYS" ]; then echo $GPG_SECRET_KEYS | base64 --decode | $GPG_EXECUTABLE --import --no-tty --batch --yes; fi + - if [ ! -z "$GPG_OWNERTRUST" ]; then echo $GPG_OWNERTRUST | base64 --decode | $GPG_EXECUTABLE --import-ownertrust; fi + - echo "mulesoft-releases\${env.NEXUS_USER}\${env.NEXUS_PASSWORD}mulesoft-snapshots\${env.NEXUS_USER}\${env.NEXUS_PASSWORD}ossrh\${env.OSSRH_USER}\${env.OSSRH_PASSWORD}ossrhtrue\${env.GPG_EXECUTABLE}\${env.GPG_KEY_NAME}\${env.GPG_PASSPHRASE}" > ~/settings.xml + +install: + - mvn install --settings ~/settings.xml -DskipTests=true -Dgpg.skip -Dmaven.javadoc.skip=true -B -V + +deploy: + # This provider handles pr merges to master and creates a SNAPSHOT + - provider: script + script: mvn deploy --settings ~/settings.xml -DskipTests -B -U + skip_cleanup: true + on: + repo: raml-org/raml-java-parser + all_branches: true + condition: $TRAVIS_BRANCH =~ ^0.8.x$ + # This provider handles tags of version 0.8 + - provider: script + script: bash scripts/release.sh $TRAVIS_TAG + skip_cleanup: true + on: + repo: raml-org/raml-java-parser + tags: true + condition: $TRAVIS_TAG =~ ^0\.8\.[0-9]+$ diff --git a/pom.xml b/pom.xml index 8fe4c546..dce47c52 100644 --- a/pom.xml +++ b/pom.xml @@ -66,6 +66,8 @@ **/*.xsd **/*.properties **/*.md + private/** + scripts/release.sh **/build-number.txt diff --git a/scripts/release.sh b/scripts/release.sh new file mode 100644 index 00000000..a0e225e1 --- /dev/null +++ b/scripts/release.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +#Copyright 2016 (c) MuleSoft, Inc. +# +#Licensed under the Apache License, Version 2.0 (the "License"); +#you may not use this file except in compliance with the License. +#You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +#Unless required by applicable law or agreed to in writing, +#software distributed under the License is distributed on an +#"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +#either express or implied. See the License for the specific +#language governing permissions and limitations under the License. + +TRAVIS_TAG=$1 +mvn --settings ~/settings.xml org.codehaus.mojo:versions-maven-plugin:2.1:set -DnewVersion=$TRAVIS_TAG && \ + mvn clean deploy --settings ~/settings.xml -DskipTests=true -B -U \ No newline at end of file