forked from SpaiR/StrongDMM
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
87 lines (74 loc) · 2.42 KB
/
Taskfile.yml
File metadata and controls
87 lines (74 loc) · 2.42 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
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/env.Version={{.GIT_VERSION}} -X sdmm/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: src/third_party/sdmmparser/src
cmds:
- cargo clean
clean:
deps:
- clean-sdmmparser
- clean-sdmm
run:
deps:
- build-sdmmparser
dir: src
cmds:
- go run {{.BUILD_ARGS}} .
build:
deps:
- build-sdmmparser
dir: src
cmds:
- task: pre-process-resources
- go build {{.BUILD_ARGS}} -o "../dst/{{.BIN_DST}}" .
- task: post-process-resources
build-sdmmparser:
dir: src/third_party/sdmmparser/src
cmds:
- cargo build --release
pre-process-resources:
cmds:
- mv src/rsc/txt/changelog-body.txt src/rsc/txt/changelog-body.txt.bk
- cp CHANGELOG.md src/rsc/txt/changelog-body.txt
post-process-resources:
cmds:
- mv src/rsc/txt/changelog-body.txt.bk src/rsc/txt/changelog-body.txt
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