From 482d9ddd45d41f3243efe8a5743eeee88418beee Mon Sep 17 00:00:00 2001 From: WithoutPants <53250216+WithoutPants@users.noreply.github.com> Date: Thu, 28 Nov 2019 05:17:32 +1100 Subject: [PATCH] Upload pull request builds to transfer.sh (#165) * Upload pull request builds to transfer.sh --- .travis.yml | 7 +++++-- scripts/upload-pull-request.sh | 11 +++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 scripts/upload-pull-request.sh diff --git a/.travis.yml b/.travis.yml index 2c51b94a4..f89c547b2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,11 +17,14 @@ script: #- make lint #- make vet - make it -before_deploy: -- if [ "$TRAVIS_BRANCH" = "develop" ]; then export TAG_SUFFIX="_dev"; fi +after_success: +- if [ "$TRAVIS_BRANCH" = "develop" ]; then export TAG_SUFFIX="_dev"; elif [ "$TRAVIS_BRANCH" != "master" ]; then export TAG_SUFFIX="_$TRAVIS_BRANCH"; fi - export STASH_VERSION="v0.0.0-alpha${TAG_SUFFIX}" - docker pull stashapp/compiler:develop - sh ./scripts/cross-compile.sh ${STASH_VERSION} +- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then sh ./scripts/upload-pull-request.sh; fi' +before_deploy: +- if [ "$TRAVIS_BRANCH" = "develop" ]; then export TAG_SUFFIX="_dev"; fi - git tag -f ${STASH_VERSION} - git push -f --tags - export RELEASE_DATE=$(date +'%Y-%m-%d %H:%M:%S %Z') diff --git a/scripts/upload-pull-request.sh b/scripts/upload-pull-request.sh new file mode 100644 index 000000000..6a4567254 --- /dev/null +++ b/scripts/upload-pull-request.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# assumes cross-compile.sh has already been run successfully +function uploadFile(file) { + BASENAME="$(basename "${FILE}")" + curl --upload-file $FILE "https://transfer.sh/$BASENAME" +} + +uploadFile("dist/stash-osx") +uploadFile("dist/stash-win.exe") +uploadFile("dist/stash-linux")