-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add mechanism to release binaries properly
Signed-off-by: Ali Yousuf <[email protected]>
- Loading branch information
1 parent
548fde7
commit c31d7f4
Showing
3 changed files
with
73 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,62 @@ | ||
# Golang CircleCI 2.0 configuration file | ||
# | ||
# Check https://circleci.com/docs/2.0/language-go/ for more details | ||
version: 2 | ||
jobs: | ||
build: | ||
docker: | ||
- image: circleci/golang:1.9 | ||
|
||
working_directory: /go/src/github.com/alyyousuf7/twenty48 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Build binary | ||
command: make binary | ||
|
||
test: | ||
docker: | ||
- image: circleci/golang:1.9 | ||
working_directory: /go/src/github.com/alyyousuf7/twenty48 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Run unit tests | ||
command: make test | ||
- run: | ||
name: Build binary | ||
command: make binary | ||
|
||
coverage: | ||
docker: | ||
- image: circleci/golang:1.9 | ||
working_directory: /go/src/github.com/alyyousuf7/twenty48 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Generate coverage report | ||
command: make coverage | ||
- run: | ||
name: Upload coverage report to codecov | ||
command: bash <(curl -s https://codecov.io/bash) | ||
command: bash <(curl -s https://codecov.io/bash) | ||
|
||
release: | ||
docker: | ||
- image: circleci/golang:1.9 | ||
working_directory: /go/src/github.com/alyyousuf7/twenty48 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Release with goreleaser | ||
command: curl -sSL git.io/goreleaser | bash | ||
|
||
workflows: | ||
version: 2 | ||
build-test-and-release: | ||
jobs: | ||
- build | ||
- test | ||
- coverage: | ||
requires: | ||
- test | ||
- release: | ||
requires: | ||
- test | ||
filters: | ||
branches: | ||
ignore: /.*/ | ||
tags: | ||
only: /^v[0-9]+\.[0-9]+\.[0-9]+$/ # vx.x.x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
*.so | ||
*.dylib | ||
bin/ | ||
dist/ | ||
|
||
# Test binary, build with `go test -c` | ||
*.test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Build for darwin, linux and windows | ||
builds: | ||
- main: ./cmd/twenty48 | ||
goos: | ||
- darwin | ||
- linux | ||
- windows | ||
goarch: | ||
- 386 | ||
- amd64 | ||
|
||
# Make release files look nice | ||
archive: | ||
replacements: | ||
386: 32-bit | ||
amd64: 64-bit | ||
format: tar.gz | ||
format_overrides: | ||
- goos: windows | ||
format: zip | ||
files: | ||
- LICENSE | ||
|
||
# Do not publish the release yet | ||
release: | ||
draft: true | ||
name_template: "{{.ProjectName}}-v{{.Version}}" |