always delete continuous release from github releases

re-create it if untagged, otherwise create regular release
This commit is contained in:
Sebastian Stenzel
2018-03-27 16:42:01 +02:00
parent f2107954b3
commit e1eafbc838

View File

@@ -5,6 +5,10 @@ jdk:
branches:
except:
- continuous # To avoid infinite loops, as this tag is created by this Travis config
addons:
apt:
packages:
- jq
cache:
directories:
- $HOME/.m2
@@ -35,11 +39,16 @@ after_success:
- $JAVA_HOME/bin/java -cp ~/codacy-coverage-reporter-assembly-latest.jar com.codacy.CodacyCoverageReporter -l Java -r main/jacoco-report/target/site/jacoco-aggregate/jacoco.xml
before_deploy:
- jdk_switcher use oraclejdk9
- |
CONTINUOUS_RELEASE_URL=`curl -s https://api.github.com/repos/cryptomator/cryptomator/releases/tags/continuous | jq -re '.url'`
if [ $? -eq 0 ]; then
curl -u cryptobot:$GITHUB_API_KEY -X DELETE $CONTINUOUS_RELEASE_URL
fi
- |
if [ -n "$TRAVIS_TAG" ]; then
mvn -fmain/pom.xml org.codehaus.mojo:versions-maven-plugin:set -DnewVersion=$TRAVIS_TAG
else
mvn -fmain/pom.xml org.codehaus.mojo:versions-maven-plugin:set -DnewVersion=SNAPSHOT-$TRAVIS_COMMIT
mvn -fmain/pom.xml org.codehaus.mojo:versions-maven-plugin:set -DnewVersion=SNAPSHOT-$(date +'%FT%T')
git tag -f continuous
git remote add gh https://cryptobot:${GITHUB_API_KEY}@github.com/cryptomator/cryptomator.git
git push -f gh continuous
@@ -50,7 +59,7 @@ deploy:
- provider: releases # CONTINUOUS
prerelease: true
api-key: $GITHUB_API_KEY
target_commitish: $TRAVIS_COMMIT
tag_name: continuous
overwrite: true
file_glob: true
file: