Repository navigation
Expand file tree
/
Copy pathTaskfile.yml
More file actions
128 lines (113 loc) · 3.25 KB
/
Copy pathTaskfile.yml
File metadata and controls
128 lines (113 loc) · 3.25 KB
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
version: "3"
vars:
VERSION:
sh: git describe --tags --exact-match 2>/dev/null || echo "v0.0.0"
COMMIT_COUNT:
sh: git rev-list --count HEAD
tasks:
clean:
desc: Clean build artifacts
deps: ['clean:bin', 'clean:version-info']
clean:bin:
desc: Clean build directory
cmds:
- rm -rf bin/*
status:
- test -z "$(find bin -maxdepth 1 -type f -print -quit)"
clean:version-info:
desc: Clean autogenerated version info
dir: cmd/p86l
cmds:
- rm -f versioninfo.json
- rm -f app.manifest
- rm -f resource.syso
sources:
- versioninfo.json
- app.manifest
- resource.syso
status:
- test ! -f versioninfo.json
- test ! -f app.manifest
- test ! -f resource.syso
clean:build-artifacts:
desc: Clean build artifacts but keep zips
dir: bin
cmds:
- rm -f Project-86-Launcher.exe icon.ico icon.png
- rm -rf Project-86-Launcher
run:
cmds:
- go run cmd/p86l/main.go
build:
desc: Build all release artifacts
cmds:
- task: build:windows
- task: package:zip
- task: package:checksum
- task: clean:build-artifacts
build:debug:
cmds:
- go build -ldflags "-s -w" -trimpath -o bin/ cmd/p86l/main.go
build:windows:
cmds:
- GOOS=windows GOARCH=amd64 go build -ldflags "-s -w -X main.VERSION={{.VERSION}} -X=runtime.godebugDefault=asyncpreemptoff=1 -H=windowsgui" -trimpath -o bin/Project-86-Launcher.exe ./cmd/p86l
generates:
- bin/Project-86-Launcher.exe
generate:version-info:
desc: Generate versioninfo.json with proper version data
cmds:
- go run ./scripts/version.go {{default "v0.0.0" .VERSION}} {{.COMMIT_COUNT}}
- go generate ./cmd/p86l
sources:
- scripts/version.go
- .git/HEAD
- .git/refs/tags/*
generates:
- cmd/p86l/versioninfo.json
- cmd/p86l/app.manifest
- cmd/p86l/resource.syso
package:zip:
desc: Create ZIP archives for Windows executables
deps: ['package:zip-assets']
dir: bin
cmds:
- |
APP_DIR="Project-86-Launcher-{{.VERSION}}/Project-86-Launcher"
mkdir -p "$APP_DIR"
cp Project-86-Launcher.exe "$APP_DIR/"
cp icon.ico "$APP_DIR/"
cp icon.png "$APP_DIR/"
zip -r "Project-86-Launcher-{{.VERSION}}.zip" "Project-86-Launcher-{{.VERSION}}"
rm -rf "Project-86-Launcher-{{.VERSION}}"
sources:
- "Project-86-Launcher.exe"
- "icon.ico"
- "icon.png"
generates:
- "Project-86-Launcher-{{.VERSION}}.zip"
package:zip-assets:
desc: Copy assets needed for zip to bin directory
cmds:
- cp assets/images/icon.ico bin/
- cp assets/images/icon.png bin/
sources:
- assets/icon.ico
- assets/icon.png
generates:
- bin/icon.ico
- bin/icon.png
status:
- test -f bin/icon.ico
- test -f bin/icon.png
package:checksum:
desc: Generate SHA256 checksums for release files
dir: bin
cmds:
- sha256sum Project-86-Launcher-{{.VERSION}}.zip Project-86-Launcher.exe icon.ico icon.png > sha256sum.txt
sources:
- "Project-86-Launcher-{{.VERSION}}.zip"
- "Project-86-Launcher.exe"
- "icon.ico"
- "icon.png"
generates:
- sha256sum.txt