-
-
Notifications
You must be signed in to change notification settings - Fork 75
/
Taskfile.yml
85 lines (72 loc) · 2.44 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
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:
default:
cmds:
- task: clean
- task: build
clean-parser:
dir: third_party/sdmmparser/src
cmds:
- cargo clean
clean-editor:
cmds:
- '{{if eq OS "windows"}}cmd /C "if exist dst (rmdir /S /Q dst)"{{else}}rm -frd ./dst{{end}}'
clean:
deps:
- clean-parser
- clean-editor
build-parser:
dir: third_party/sdmmparser/src
vars:
RUST_TARGET_DYN: "{{if eq .OS \"Windows_NT\"}}stable-x86_64-pc-windows-gnu{{else}}stable{{end}}"
RUSTUP_TOOLCHAIN: "{{.RUST_TARGET | default .RUST_TARGET_DYN}}"
cmds:
- RUSTUP_TOOLCHAIN={{.RUSTUP_TOOLCHAIN}} cargo build --release
build-editor:
cmds:
- go build {{.BUILD_ARGS}} -o "dst/{{.BIN_DST}}" .
build:
cmds:
- task: build-parser
- task: build-editor
run:
deps:
- build-parser
cmds:
- go run {{.BUILD_ARGS}} .
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