Skip to content
This repository was archived by the owner on Feb 12, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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 "<settings><servers><server><id>mulesoft-releases</id><username>\${env.NEXUS_USER}</username><password>\${env.NEXUS_PASSWORD}</password></server><server><id>mulesoft-snapshots</id><username>\${env.NEXUS_USER}</username><password>\${env.NEXUS_PASSWORD}</password></server><server><id>ossrh</id><username>\${env.OSSRH_USER}</username><password>\${env.OSSRH_PASSWORD}</password></server></servers><profiles><profile><id>ossrh</id><activation><activeByDefault>true</activeByDefault></activation><properties><gpg.executable>\${env.GPG_EXECUTABLE}</gpg.executable><gpg.keyname>\${env.GPG_KEY_NAME}</gpg.keyname><gpg.passphrase>\${env.GPG_PASSPHRASE}</gpg.passphrase></properties></profile></profiles></settings>" > ~/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]+$
2 changes: 2 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
<exclude>**/*.xsd</exclude>
<exclude>**/*.properties</exclude>
<exclude>**/*.md</exclude>
<exclude>private/**</exclude>
<exclude>scripts/release.sh</exclude>
<exclude>**/build-number.txt</exclude>
</excludes>
<mapping>
Expand Down
18 changes: 18 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -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