Skip to content

Commit

Permalink
Run release step on tags
Browse files Browse the repository at this point in the history
  • Loading branch information
lox committed Jan 2, 2017
1 parent 935f29e commit 57844a5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
1 change: 0 additions & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ steps:

- name: ":github: Release"
command: .buildkite/release.sh
branches: "master add-buildkite-ci"

15 changes: 9 additions & 6 deletions .buildkite/release.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/bash
set -eu -o pipefail

if [[ ! "$BUILDKITE_TAG" =~ ^v ]] ; then
echo "Skipping non-tag build"
exit 0
fi

VERSION="$(git describe --tags --candidates=1 2>/dev/null || echo dev)"

download_github_release() {
Expand All @@ -13,12 +18,10 @@ github_release() {
./github-release lox/parfait "$version" "$BUILDKITE_COMMIT" "$(git cat-file -p "$version" | tail -n +6)" 'build/*'
}

download_github_release

echo "--- Downloading build artifacts"
buildkite-agent artifact download 'build/*' .

if [[ "$BUILDKITE_TAG" =~ ^v ]] ; then
download_github_release

echo "+++ Releasing version ${VERSION} on github.com"
github_release "${VERSION}"
fi
echo "+++ Releasing version ${VERSION} on github.com"
github_release "${VERSION}"

0 comments on commit 57844a5

Please sign in to comment.