-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
37 lines (32 loc) · 1.2 KB
/
Taskfile.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
version: '3'
vars:
PROGRAM: everdoadd
tasks:
test:
- go test -failfast ./...
build:
deps: [test]
cmds:
- autoversion
- go build -o {{.PROGRAM}} cmd/main.go
install:
deps: [build]
cmds:
- cp {{.PROGRAM}} ~/go/bin/ea
# does not call [build] task.
# you need to do this manually before create-release-for-github
# otherwise the current version number cannot be determined since
# the vars: section always runs before any other deps
create-release-for-github:
vars:
PRG_VERSION:
sh: ./everdoadd --version
cmds:
- rm releases/*
- GOOS=darwin GOARCH=amd64 go build -o releases/{{.PROGRAM}}_{{.PRG_VERSION}}_darwin_amd64 cmd/main.go
- GOOS=darwin GOARCH=arm64 go build -o releases/{{.PROGRAM}}_{{.PRG_VERSION}}_darwin_arm64 cmd/main.go
- GOOS=linux GOARCH=amd64 go build -o releases/{{.PROGRAM}}_{{.PRG_VERSION}}_linux_amd64 cmd/main.go
- GOOS=windows GOARCH=amd64 go build -o releases/{{.PROGRAM}}_{{.PRG_VERSION}}_windows_amd64.exe cmd/main.go
# https://cli.github.com/manual/gh_release_create
# https://github.com/cli/cli
- gh release create v{{.PRG_VERSION}} ./releases/* --title v{{.PRG_VERSION}}