-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
97 lines (84 loc) · 2.56 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
version: '3'
vars:
TEMP:
sh: mktemp -d
VERSION:
sh: git describe --tags --exact-match 2>/dev/null || git describe --tags 2>/dev/null || echo "v0.0.0-$(git rev-parse --short HEAD)"
tasks:
default:
- task: clean
- task: lint
- task: tests
- task: build
clean:
desc: Clean output folder
cmds:
- rm -rf out/*
build:
desc: Build binary
cmds:
- go mod tidy
- go build ./...
lint:
desc: Lint
cmds:
- go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.52.2 run ./...
tests:
desc: Go tests
cmds:
- go test -v ./...
generate:
desc: Generate assets
cmds:
- go generate ./...
sources:
- assets/winres.json
- assets/icon22.png
- assets/icon.ico
generates:
- rsrc_windows_amd64.syso
- internal/icon/icon_unix.go
- internal/icon/icon_windows.go
build:darwin:
desc: Build for darwin/amd64
deps: [ generate ]
cmds:
- go build -a -ldflags="-s -w -X 'main.twitchClientID=${TWITCH_CLIENT_ID}' -X 'main.twitchClientSecret=${TWITCH_SECRET_ID}'" -tags production -o "{{.TEMP}}/twitch_clip_${GOOS}_${GOARCH}" .
env:
GOOS: darwin
GOARCH: amd64
CGO_ENABLED: "1"
package:darwin:
desc: Package binary as macOS app
deps: [ build:darwin ]
cmds:
- go run hack/macapp.go -assets "{{.TEMP}}" -bin "twitch_clip_${GOOS}_${GOARCH}" -icon ./assets/icon1080.png -identifier com.skynewz.twitchclip -name "Twitch Clip" -o ./out/
- zip -r ./out/twitch_clip_${GOOS}_${GOARCH}_{{ .VERSION }}.zip "./out/Twitch Clip.app" README.md LICENSE && rm -r "./out/Twitch Clip.app"
env:
GOOS: darwin
GOARCH: amd64
build:windows:
desc: Build windows/amd64
deps: [ generate ]
cmds:
- go build -a -ldflags="-s -w -X 'main.twitchClientID=${TWITCH_CLIENT_ID}' -X 'main.twitchClientSecret=${TWITCH_SECRET_ID}' -H=windowsgui" -tags production -o "out/twitch_clip_${GOOS}_${GOARCH}_{{ .VERSION }}.exe" .
env:
GOOS: windows
GOARCH: amd64
CGO_ENABLED: "1"
CC: x86_64-w64-mingw32-gcc
CXX: x86_64-w64-mingw32-g++
build:linux:
desc: Build linux/amd64
deps: [ generate ]
cmds:
- go build -a -ldflags="-s -w -X 'main.twitchClientID=${TWITCH_CLIENT_ID}' -X 'main.twitchClientSecret=${TWITCH_SECRET_ID}'" -tags production -o "out/twitch_clip_${GOOS}_${GOARCH}_{{ .VERSION }}.exe" .
env:
GOOS: linux
GOARCH: amd64
CGO_ENABLED: "1"
CC: gcc
changelog:
desc: Update CHANGELOG.md
cmds:
- git-chglog > CHANGELOG.md