Просмотр исходного кода

always delete continuous release from github releases
re-create it if untagged, otherwise create regular release

Sebastian Stenzel 7 лет назад
Родитель
Сommit
e1eafbc838
1 измененных файлов с 11 добавлено и 2 удалено
  1. 11 2
      .travis.yml

+ 11 - 2
.travis.yml

@@ -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: