add circleci and goreleaser yaml

develop 1.0.0
skanehira 4 years ago
parent e252de3deb
commit cc83ce3052

@ -0,0 +1,117 @@
version: 2.1
executors:
build:
parameters:
go-version:
type: string
docker:
- image: circleci/golang:<< parameters.go-version >>
environment:
GO111MODULE: "on"
working_directory: /go/src/github.com/skanehira/tson
commands:
go_mod_download:
steps:
- restore_cache:
name: Restore go modules cache
keys:
- go-modules-{{ checksum "go.sum" }}
- run: go mod download
- save_cache:
name: Save go modules cache
key: go-modules-{{ checksum "go.sum" }}
paths:
- "/go/pkg/mod"
jobs:
build:
parameters:
go-version:
type: string
executor:
name: build
go-version: << parameters.go-version >>
steps:
- checkout
- go_mod_download
lint:
parameters:
go-version:
type: string
golangci-lint-version:
type: string
executor:
name: build
go-version: << parameters.go-version >>
steps:
- checkout
- go_mod_download
- run:
name: Install GolangCI-Lint
command: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v<< parameters.golangci-lint-version >>
- run:
name: Run GolangCI-Lint
command: ./bin/golangci-lint run --disable-all --enable=goimports --enable=govet
release:
parameters:
go-version:
type: string
executor:
name: build
go-version: << parameters.go-version >>
steps:
- checkout
- go_mod_download
- run:
name: Run goreleaser
command: curl -sL https://git.io/goreleaser | bash -s -- --rm-dist
workflows:
stable-build:
jobs:
- lint:
go-version: "1.13.3"
golangci-lint-version: "1.17.1"
- build:
go-version: "1.13.3"
requires:
- lint
latest-build:
jobs:
- lint:
go-version: "1.13.3"
golangci-lint-version: "1.17.1"
- build:
go-version: "1.13.3"
requires:
- lint
release:
jobs:
- lint:
go-version: "1.13.3"
golangci-lint-version: "1.17.1"
- release:
go-version: "1.13.3"
filters:
branches:
ignore: /.*/
tags:
only: /[0-9]+(\.[0-9]+)(\.[0-9]+)/

@ -0,0 +1,21 @@
project_name: tson
builds:
- env:
- CGO_ENABLED=0
- GO111MODULE=on
archives:
- replacements:
darwin: Darwin
linux: Linux
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
skip: true
Loading…
Cancel
Save