Skip to content

Commit

Permalink
Feature/new releaser (#27)
Browse files Browse the repository at this point in the history
* switch to cimg image and try goreleaser
  • Loading branch information
vadimi authored Aug 6, 2020
1 parent 4643da0 commit 9326908
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 9 deletions.
18 changes: 9 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@ version: 2
jobs:
build:
docker:
- image: circleci/golang:1.14
- image: cimg/go:1.14
environment:
TEST_RESULTS: /tmp/test-results
steps:
- run: go get -u github.com/mitchellh/gox
- checkout
- run:
name: cross compile
command: |
CGO_ENABLED=0 gox -os="linux darwin windows" -arch="amd64" -ldflags="-s -w" -output="./dist/grpc-client-cli_{{.OS}}_{{.Arch}}" ./cmd/grpc-client-cli
- run: go get github.com/jstemmer/go-junit-report
- run: mkdir -p $TEST_RESULTS
- run:
name: run tests
command: |
go test -v ./... | tee ${TEST_RESULTS}/testresults.txt
cat ${TEST_RESULTS}/testresults.txt | go-junit-report > ${TEST_RESULTS}/testresults.xml
gotestsum --junitfile ${TEST_RESULTS}/testresults.xml --format short-verbose --no-summary=skipped ./...
- run:
name: build
command: |
curl -sL https://git.io/goreleaser | bash -s -- --skip-publish --rm-dist --skip-validate
find ./dist/ -not -name '*.tar.gz' -not -name '*.zip' -not -name 'dist' -delete
- store_test_results:
path: /tmp/test-results
- store_artifacts:
path: ./dist
- persist_to_workspace:
root: .
paths:
Expand Down
25 changes: 25 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
builds:
- binary: grpc-client-cli
main: ./cmd/grpc-client-cli
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
goarch:
- amd64
- arm64
ldflags:
- -s -w

archives:
- format: tar.gz
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
files:
- none* # binaries only
format_overrides:
- goos: windows
format: zip
replacements:
amd64: x86_64
2 changes: 2 additions & 0 deletions cmd/grpc-client-cli/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
grpc-client-cli
grpc-client-cli.exe

.bin/

0 comments on commit 9326908

Please sign in to comment.