travis: use stages and added snapshot upload

This commit is contained in:
Karl Tauber
2020-02-05 15:29:00 +01:00
parent 84d05603ef
commit a000c8fd99

View File

@@ -19,11 +19,25 @@ before_install:
- ./gradlew --version
- java -version
deploy:
provider: script
script: ./gradlew bintrayUpload
skip_cleanup: true # to upload artifacts created during the build
on:
branch: master
jdk: openjdk11
tags: true
stages:
- name: build
- name: snapshot
if: branch = master AND type IN (push) AND tag IS blank
- name: release
if: branch = master AND type IN (push) AND tag IS present
jobs:
include:
# run gradle build
- stage: build
script: ./gradlew build
# publish snapshot to oss.jfrog.org
- stage: snapshot
jdk: openjdk11
script: ./gradlew artifactoryPublish
# release a new stable version to bintray
- stage: release
jdk: openjdk11
script: ./gradlew bintrayUpload -Drelease=true