From bbed8843ef9d614909fe4b9f5d3eb6e42ae03b72 Mon Sep 17 00:00:00 2001 From: Vadim Pisaruk Date: Tue, 18 Jun 2019 17:38:35 +0300 Subject: [PATCH] Publish binaries (#157) * Auto publishing red-box binaries --- .circleci/config.yml | 40 +++++++++++++++++++++++++++++++++++++++- Makefile | 10 ++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f69f3bf..92f273a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,6 +22,10 @@ jobs: - run: name: Build red-box command: make + - persist_to_workspace: + root: /go + paths: + - src/github.com/sylabs/slurm-operator/bin/red-box test: docker: @@ -128,22 +132,47 @@ jobs: chmod +x push.sh ./push.sh + release_binaries: + docker: + - image: circleci/golang:1.12 + working_directory: /go/src/github.com/sylabs/slurm-operator + steps: + - attach_workspace: + at: /go + - run: + name: Release binaries + command: GITHUB_TOKEN=$SYLABS_GITHUB_TOKEN RELEASE_TAG=$CIRCLE_TAG BINARY_PATH=bin/red-box make release_binaries + workflows: version: 2 build_test_publish: jobs: - - get_source + - get_source: + filters: + tags: + only: /.*/ - build: + filters: + tags: + only: /.*/ requires: - get_source - test: + filters: + tags: + only: /.*/ requires: - get_source - lint: + filters: + tags: + only: /.*/ requires: - get_source - publish: filters: + tags: + ignore: /.*/ branches: only: - master @@ -152,3 +181,12 @@ workflows: - build - test - lint + - release_binaries: + filters: + tags: + only: /.*/ + branches: + ignore: /.*/ + requires: + - build + diff --git a/Makefile b/Makefile index 45fccd3..9e4879e 100644 --- a/Makefile +++ b/Makefile @@ -50,3 +50,13 @@ dep: .PHONY: gen gen: $(V)go generate generate.go + +.PHONY: release_binaries +release_binaries: + $(V)go get -u github.com/itchio/gothub + $(V)gothub upload --user sylabs \ + --repo slurm-operator \ + --tag ${RELEASE_TAG} \ + --name "red-box" \ + --file ${BINARY_PATH} +