From a81cccd37679a213727b7848bd135e1a84c3ce95 Mon Sep 17 00:00:00 2001 From: Marc O'Morain Date: Tue, 12 Jun 2018 21:32:50 +0100 Subject: [PATCH] Install goreleaser and use it to publish binaries to GitHub releases. --- .circleci/config.yml | 33 +++++++++++++++++++++++++++++++++ .gitignore | 1 + .goreleaser.yml | 13 +++++++++++++ CONTRIBUTING.md | 9 +++++++++ README.md | 14 -------------- 5 files changed, 56 insertions(+), 14 deletions(-) create mode 100644 .goreleaser.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index a9794da02..e59b4740f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,6 +7,14 @@ workflows: - test - coverage - lint + - deploy: + requires: + - test + - coverage + - lint + filters: + branches: + only: master jobs: test: @@ -53,3 +61,28 @@ jobs: go get -u github.com/alecthomas/gometalinter gometalinter --install - run: make lint + + deploy: + docker: + - image: circleci/golang:1.10 + environment: + GORELEASER_URL: https://github.com/goreleaser/goreleaser/releases/download/v0.77.1/goreleaser_amd64.deb + + working_directory: /go/src/github.com/circleci/circleci-cli + steps: + - checkout + - run: + name: Install GoReleaser + command: | + curl --silent --location --fail --retry 3 $GORELEASER_URL > /tmp/goreleaser_amd64.deb + sudo apt install /tmp/goreleaser_amd64.deb + - run: + name: Tag Repo + command: | + git config --global user.email "marc@circleci.com" + git config --global user.name "Marc O'Morain" + git tag -a "v0.1.$CIRCLE_BUILD_NUM" -m "Release v0.1.$CIRCLE_BUILD_NUM" + git push origin "v0.1.$CIRCLE_BUILD_NUM" + - run: + name: Release + command: goreleaser diff --git a/.gitignore b/.gitignore index 7596c58be..b7ecc2c10 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ build/ TODO circleci-cli coverage.txt +dist/ diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 000000000..c4e4343a6 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,13 @@ +archive: + format_overrides: + - goos: windows + format: zip + +builds: + - binary: circleci-beta + goos: + - windows + - darwin + - linux + goarch: + - amd64 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2f1174583..97d58dcc5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -72,3 +72,12 @@ For example, I've the following in my `.emacs.d/init.el`: (add-hook 'before-save-hook 'gofmt-before-save) (require 'go-rename) ``` + +## Viewing API Documentation + +You can view the documentation for this project in your browser using `godoc`. + +After installing it via `make dev`. + +1. Run `make doc`. +2. Access http://localhost:6060/pkg/github.com/circleci/circleci-cli/ diff --git a/README.md b/README.md index af20c4508..547828411 100644 --- a/README.md +++ b/README.md @@ -100,17 +100,3 @@ This should pretty-print back a JSON response from the server: } } ``` - -## Known Issues - -* ... - -## Viewing API Documentation - -You can view the documentation for this project in your browser using `godoc`. - -After installing it via `make dev`. - -1. Run `make doc`. -2. Access http://localhost:6060/pkg/github.com/circleci/circleci-cli/ -