Skip to content
Permalink
Browse files

Do not run snapshot deployment when a commit with tag is pushed. This…

… is done by checking if version contains SNAPSHOT.
  • Loading branch information...
abhinayagarwal committed Jul 8, 2019
1 parent c832f91 commit cdad7beeb20bb2952060f6f35acb6db9560c7d86
Showing with 19 additions and 6 deletions.
  1. +10 −0 .ci/deploy-snapshot.sh
  2. +4 −6 .travis.yml
  3. +5 −0 build.gradle
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

# Find project version
ver=$(./gradlew -q :controlsfx:getVersion | tail -n 1)

# deploy if snapshot found
if [[ $ver == *"SNAPSHOT"* ]]
then
./gradlew uploadPublished -PsonatypeUsername=$SONATYPE_USERNAME -PsonatypePassword=$SONATYPE_PASSWORD
fi
@@ -19,8 +19,7 @@ os: linux
install: true

# Assemble jars
script:
- ./gradlew clean assemble -Ptransifex.api=$TRANSIFEX_API
script: ./gradlew clean assemble -Ptransifex.api=$TRANSIFEX_API

cache:
directories:
@@ -29,15 +28,14 @@ cache:
deploy:
# Deploy snapshots on every commit made to master and 9.0.0 branch
- provider: script
script: ./gradlew uploadPublished -PsonatypeUsername=$SONATYPE_USERNAME -PsonatypePassword=$SONATYPE_PASSWORD
script: bash .ci/deploy-snapshot.sh
skip_cleanup: true
on:
tags: false
all_branches: true
condition: $TRAVIS_BRANCH =~ ^master|9.0.0$

# Deploy releases on every tag push
- provider: script
script: sh .ci/deploy.sh
script: bash .ci/deploy.sh
skip_cleanup: true
on:
tags: true
@@ -73,4 +73,9 @@ subprojects {
archives javadocJar
}

// Used in Travis
task getVersion << {
println "$project.version"
}

}

0 comments on commit cdad7be

Please sign in to comment.
You can’t perform that action at this time.