From 65900eef17265372c4a7f3f7990b530ada49557c Mon Sep 17 00:00:00 2001 From: Gorka Lerchundi Osa Date: Mon, 19 Oct 2015 22:57:28 +0200 Subject: [PATCH] change release method, use github-release --- .travis.yml | 21 +++++---------------- .travis.yml.after_success | 28 ++++++++++++++++++++++++++++ .travis.yml.install | 5 +++++ .travis.yml.script | 3 +++ 4 files changed, 41 insertions(+), 16 deletions(-) create mode 100644 .travis.yml.after_success create mode 100644 .travis.yml.install create mode 100644 .travis.yml.script diff --git a/.travis.yml b/.travis.yml index 928a34f..60eeffa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,19 +1,8 @@ -sudo: false language: c compiler: gcc +install: +- bash -e ${TRAVIS_BUILD_DIR}/.travis.yml.install script: -- cd skarnet-builder && ./build-wrapper -deploy: - provider: releases - skip_cleanup: true - api_key: - secure: "QNiQi8CpOEorAm1CAJjl18A+RCNjUhabH3anL6LeOynY1ggrgSGR2MbJsgWaE7Zc98PlMc5JlJrXuKbwGR5fw6ox42gCriuELwHOj9rpmGIimgVIx5tWBeOzSF+iWSB5xwYnL49xvsYynlHdfKtJ5k3BHxCNUcDWFUZKdzg5Mhk=" - file: $HOME/dist/* - file: - - $HOME/dist/manifest*.txt - - $HOME/dist/*.tar.gz - file_glob: true - on: - repo: just-containers/skaware - branch: master - tags: true +- bash -e ${TRAVIS_BUILD_DIR}/.travis.yml.script +after_success: +- bash -e ${TRAVIS_BUILD_DIR}/.travis.yml.after_success diff --git a/.travis.yml.after_success b/.travis.yml.after_success new file mode 100644 index 0000000..acaca70 --- /dev/null +++ b/.travis.yml.after_success @@ -0,0 +1,28 @@ +#!/bin/bash + +# don't loop if files don't exist +shopt -s nullglob + +# exit if TRAVIS_TAG is empty, no need to release anything +if [ -z "${TRAVIS_TAG}" ]; then + exit 0 +fi + +# get user and repo names +USERNAME=$(echo ${TRAVIS_REPO_SLUG} | cut -d"/" -f1) +REPONAME=$(echo ${TRAVIS_REPO_SLUG} | cut -d"/" -f2) + +# release +github-release release --user "${USERNAME}" --repo "${REPONAME}" --tag "${TRAVIS_TAG}" --name "${TRAVIS_TAG}" + +# manifests +for i in $HOME/dist/manifest*.txt; do + name=$(basename ${i}) + github-release upload --user "${USERNAME}" --repo "${REPONAME}" --tag "${TRAVIS_TAG}" --name "${name}" --file "${i}" +done + +# skaware binaries +for i in $HOME/dist/*.tar.gz; do + name=$(basename ${i}) + github-release upload --user "${USERNAME}" --repo "${REPONAME}" --tag "${TRAVIS_TAG}" --name "${name}" --file "${i}" +done diff --git a/.travis.yml.install b/.travis.yml.install new file mode 100644 index 0000000..7e9946b --- /dev/null +++ b/.travis.yml.install @@ -0,0 +1,5 @@ +#!/bin/bash + +# download and untar github-release +wget -nv -O github-release.amd64.tar.bz2 https://github.com/aktau/github-release/releases/download/v0.6.2/linux-amd64-github-release.tar.bz2 +sudo mv bin/linux/amd64/github-release /bin diff --git a/.travis.yml.script b/.travis.yml.script new file mode 100644 index 0000000..1e85242 --- /dev/null +++ b/.travis.yml.script @@ -0,0 +1,3 @@ +#!/bin/bash + +cd skarnet-builder && ./build-wrapper