-
Notifications
You must be signed in to change notification settings - Fork 119
/
circle.yml
50 lines (49 loc) · 1.57 KB
/
circle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
version: 2
jobs:
test:
working_directory: /go/src/github.com/pottava/aws-s3-proxy
docker:
- image: circleci/golang:1.13.7
steps:
- checkout
- run: go mod download
- run: go mod verify
- run: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.20.1
- run:
name: Run tests
command: |
# Circle CI kills this process because it requires a lot of memory
# ./bin/golangci-lint run --config .golangci.yml
go test -cover -bench -benchmem $(go list ./...)
build:
working_directory: /go/src/github.com/pottava/aws-s3-proxy
docker:
- image: circleci/golang:1.13.7
steps:
- checkout
- run: go mod download
- run: go mod verify
- run: go get github.com/mitchellh/gox
- run: go get github.com/tcnksm/ghr
- run:
name: Build and release
command: |
mkdir artifacts
gox --osarch "linux/amd64 darwin/amd64 windows/amd64" -ldflags "-s -w -X main.ver=${CIRCLE_TAG} -X main.commit=${CIRCLE_SHA1:0:7} -X main.date=$(date +%Y-%m-%d --utc)" -output "./artifacts/{{.OS}}_{{.Arch}}"
ghr -t $GITHUB_TOKEN -u $CIRCLE_PROJECT_USERNAME -r $CIRCLE_PROJECT_REPONAME --replace ${CIRCLE_TAG} ./artifacts/
workflows:
version: 2
dev:
jobs:
- test:
filters:
branches:
only: /.*/
release:
jobs:
- build:
filters:
branches:
ignore: /.*/
tags:
only: /v[0-9]+(\.[0-9]+)*/