-
-
Notifications
You must be signed in to change notification settings - Fork 72
/
Taskfile.yml
74 lines (63 loc) · 2.05 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
version: 3
includes:
task_win:
taskfile: ./Taskfile_windows.yml
optional: true
vars:
GIT_VERSION:
sh: git describe --tags --always
GIT_REV:
sh: git rev-parse --short HEAD
APP_NAME: StrongDMM
BIN_DST: '{{.APP_NAME}}{{exeExt}}'
BUILD_VARS: -X sdmm/internal/env.Version={{.GIT_VERSION}} -X sdmm/internal/env.Revision={{.GIT_REV}}
LD_FLAGS_WINDOWS:
sh: echo '{{if eq OS "windows"}}-H windowsgui -extldflags=-static{{end}}'
LD_FLAGS: -s -w {{.BUILD_VARS}} {{.LD_FLAGS_WINDOWS}}
BUILD_ARGS: -trimpath -ldflags="{{.LD_FLAGS}}"
tasks:
clean-sdmm:
cmds:
- rm -frd ./dst
clean-sdmmparser:
dir: third_party/sdmmparser/src
cmds:
- cargo clean
clean:
deps:
- clean-sdmmparser
- clean-sdmm
run:
deps:
- build-sdmmparser
cmds:
- go run {{.BUILD_ARGS}} .
build:
deps:
- build-sdmmparser
cmds:
- go build {{.BUILD_ARGS}} -o "dst/{{.BIN_DST}}" .
build-sdmmparser:
dir: third_party/sdmmparser/src
cmds:
- cargo build --release
release-files-unzip:
dir: dst
cmds:
- mkdir -p bin archive
- cp Windows/StrongDMM.exe bin/strongdmm-{{.GIT_VERSION}}-x86_64-pc-windows-gnu.exe
- cp Linux/StrongDMM bin/strongdmm-{{.GIT_VERSION}}-x86_64-unknown-linux-gnu
- cp macOS/StrongDMM bin/strongdmm-{{.GIT_VERSION}}-x86_64-apple-darwin
- zip -rj archive/strongdmm-windows.zip Windows
- zip -rj archive/strongdmm-linux.zip Linux
- zip -rj archive/strongdmm-macos.zip macOS
release-files-hash:
dir: dst/bin
cmds:
- sha256sum ./strongdmm-{{.GIT_VERSION}}-x86_64-pc-windows-gnu.exe | tee -a "strongdmm-{{.GIT_VERSION}}-x86_64-pc-windows-gnu.exe.sha256"
- sha256sum ./strongdmm-{{.GIT_VERSION}}-x86_64-unknown-linux-gnu | tee -a "strongdmm-{{.GIT_VERSION}}-x86_64-unknown-linux-gnu.sha256"
- sha256sum ./strongdmm-{{.GIT_VERSION}}-x86_64-apple-darwin | tee -a "strongdmm-{{.GIT_VERSION}}-x86_64-apple-darwin.sha256"
release-files:
cmds:
- task: release-files-unzip
- task: release-files-hash