2019-07-07 14:18:02 -03:00
|
|
|
version: '3'
|
2018-03-04 16:20:26 -03:00
|
|
|
|
2019-01-02 13:42:06 -02:00
|
|
|
includes:
|
2020-02-16 11:20:53 -03:00
|
|
|
docs:
|
|
|
|
taskfile: ./docs
|
|
|
|
dir: ./docs
|
2019-01-02 13:42:06 -02:00
|
|
|
|
2018-04-07 14:42:24 -03:00
|
|
|
vars:
|
|
|
|
GIT_COMMIT:
|
|
|
|
sh: git log -n 1 --format=%h
|
|
|
|
|
|
|
|
GO_PACKAGES:
|
2018-07-15 15:42:46 -03:00
|
|
|
sh: go list ./...
|
2018-04-07 14:42:24 -03:00
|
|
|
|
2018-03-04 16:20:26 -03:00
|
|
|
tasks:
|
2018-07-15 15:42:46 -03:00
|
|
|
default:
|
|
|
|
cmds:
|
|
|
|
- task: test
|
|
|
|
|
2018-03-04 16:20:26 -03:00
|
|
|
install:
|
|
|
|
desc: Installs Task
|
|
|
|
cmds:
|
|
|
|
- go install -v -ldflags="-w -s -X main.version={{.GIT_COMMIT}}" ./cmd/task
|
2018-06-16 14:24:50 -03:00
|
|
|
env:
|
|
|
|
CGO_ENABLED: '0'
|
2018-03-04 16:20:26 -03:00
|
|
|
|
2020-12-05 19:08:45 -03:00
|
|
|
mod:
|
|
|
|
desc: Downloads and tidy Go modules
|
|
|
|
cmds:
|
|
|
|
- go mod download
|
|
|
|
- go mod tidy
|
|
|
|
|
|
|
|
cli-deps:
|
|
|
|
desc: Downloads CLI dependencies
|
2018-03-04 16:20:26 -03:00
|
|
|
cmds:
|
2018-04-07 15:36:37 -03:00
|
|
|
- task: go-get
|
2018-10-13 18:29:23 -03:00
|
|
|
vars: {REPO: golang.org/x/lint/golint}
|
2018-04-07 15:36:37 -03:00
|
|
|
- task: go-get
|
|
|
|
vars: {REPO: github.com/goreleaser/goreleaser}
|
|
|
|
- task: go-get
|
|
|
|
vars: {REPO: github.com/goreleaser/godownloader}
|
2018-03-04 16:20:26 -03:00
|
|
|
|
|
|
|
clean:
|
|
|
|
desc: Cleans temp files and folders
|
|
|
|
cmds:
|
|
|
|
- rm -rf dist/
|
|
|
|
|
|
|
|
lint:
|
|
|
|
desc: Runs golint
|
|
|
|
cmds:
|
2018-07-15 15:42:46 -03:00
|
|
|
- golint {{catLines .GO_PACKAGES}}
|
2018-03-04 16:20:26 -03:00
|
|
|
silent: true
|
|
|
|
|
|
|
|
test:
|
|
|
|
desc: Runs test suite
|
|
|
|
deps: [install]
|
|
|
|
cmds:
|
2018-07-15 15:42:46 -03:00
|
|
|
- go test {{catLines .GO_PACKAGES}}
|
2018-03-04 16:20:26 -03:00
|
|
|
|
|
|
|
test-release:
|
|
|
|
desc: Tests release process without publishing
|
|
|
|
cmds:
|
2018-03-11 15:31:27 -03:00
|
|
|
- goreleaser --snapshot --rm-dist
|
2018-03-04 16:20:26 -03:00
|
|
|
|
2020-12-05 19:08:45 -03:00
|
|
|
gen-install-script:
|
2018-09-24 21:52:14 -03:00
|
|
|
desc: Generate install script using https://github.com/goreleaser/godownloader
|
2018-04-07 15:07:43 -03:00
|
|
|
cmds:
|
|
|
|
- godownloader --repo go-task/task -o install-task.sh
|
2018-09-24 21:34:10 -03:00
|
|
|
- cp ./install-task.sh ./docs/install.sh
|
2018-04-07 15:07:43 -03:00
|
|
|
|
2018-04-07 15:36:37 -03:00
|
|
|
ci:
|
2019-12-07 21:28:02 -03:00
|
|
|
- task: go-get
|
|
|
|
vars: {REPO: golang.org/x/lint/golint}
|
|
|
|
- task: lint
|
|
|
|
- task: test
|
2018-04-07 15:36:37 -03:00
|
|
|
|
2019-12-07 21:28:02 -03:00
|
|
|
go-get: go get -u {{.REPO}}
|
2018-07-15 15:42:46 -03:00
|
|
|
|
|
|
|
packages:
|
|
|
|
cmds:
|
|
|
|
- echo '{{.GO_PACKAGES}}'
|
|
|
|
silent: true
|