This repository was archived by the owner on Sep 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.g
106 lines (88 loc) · 3.18 KB
/
.g
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
[config]
default = "all"
[g]
init = [
"@run get_info"
]
fmt = [
"gorgeous ./..."
]
tag_test = [
"@echo {{.test1}}",
"@echo {{.test2}}"
]
tc = [
"@mkdir sbin",
"@cp bin sbin"
]
all = [
"@run clean",
"go mod tidy",
"@mkdir bin",
"@run windows",
"@run linux",
"@echo Done!"
]
build = [
"@env CGO_ENABLED 0",
"@env GOARCH amd64",
"go build -ldflags \"-s -w -X 'main.SoftBuildTime={{.time.utc}}' -X 'main.SoftCommit={{.commit}}' -X 'main.SoftVersion={{.version}}' -X 'main.SoftVersionCode={{.version_code}}'\""
]
clean = [
"@rm bin"
]
linux = [
"@env GOOS linux",
"@env CGO_ENABLED 0",
"@run linux_arm",
"@run linux_arm64",
"@run linux_x86",
"@run linux_amd64"
]
linux_arm = [
"@env GOARCH arm",
"go build -ldflags \"-s -w -X 'main.SoftBuildTime={{.time.utc}}' -X 'main.SoftCommit={{.commit}}' -X 'main.SoftVersion={{.version}}' -X 'main.SoftVersionCode={{.version_code}}'\" -o ./bin/gmake2_v{{.version}}_linux_arm"
]
linux_arm64 = [
"@env GOARCH arm64",
"go build -ldflags \"-s -w -X 'main.SoftBuildTime={{.time.utc}}' -X 'main.SoftCommit={{.commit}}' -X 'main.SoftVersion={{.version}}' -X 'main.SoftVersionCode={{.version_code}}'\" -o ./bin/gmake2_v{{.version}}_linux_arm64"
]
linux_x86 = [
"@env GOARCH 386",
"go build -ldflags \"-s -w -X 'main.SoftBuildTime={{.time.utc}}' -X 'main.SoftCommit={{.commit}}' -X 'main.SoftVersion={{.version}}' -X 'main.SoftVersionCode={{.version_code}}'\" -o ./bin/gmake2_v{{.version}}_linux_386"
]
linux_amd64 = [
"@env GOARCH amd64",
"go build -ldflags \"-s -w -X 'main.SoftBuildTime={{.time.utc}}' -X 'main.SoftCommit={{.commit}}' -X 'main.SoftVersion={{.version}}' -X 'main.SoftVersionCode={{.version_code}}'\" -o ./bin/gmake2_v{{.version}}_linux_amd64"
]
windows = [
"@env GOOS windows",
"@env CGO_ENABLED 0",
"@run windows_amd64",
"@run windows_x86",
"@run windows_arm",
"@run windows_arm64",
]
windows_amd64 = [
"@env GOARCH amd64",
"go build -ldflags \"-s -w -X 'main.SoftBuildTime={{.time.utc}}' -X 'main.SoftCommit={{.commit}}' -X 'main.SoftVersion={{.version}}' -X 'main.SoftVersionCode={{.version_code}}'\" -o ./bin/gmake2_v{{.version}}_windows_amd64.exe"
]
windows_x86 = [
"@env GOARCH 386",
"go build -ldflags \"-s -w -X 'main.SoftBuildTime={{.time.utc}}' -X 'main.SoftCommit={{.commit}}' -X 'main.SoftVersion={{.version}}' -X 'main.SoftVersionCode={{.version_code}}'\" -o ./bin/gmake2_v{{.version}}_windows_386.exe"
]
windows_arm = [
"@env GOARCH arm",
"go build -ldflags \"-s -w -X 'main.SoftBuildTime={{.time.utc}}' -X 'main.SoftCommit={{.commit}}' -X 'main.SoftVersion={{.version}}' -X 'main.SoftVersionCode={{.version_code}}'\" -o ./bin/gmake2_v{{.version}}_windows_arm.exe"
]
windows_arm64 = [
"@env GOARCH arm64",
"go build -ldflags \"-s -w -X 'main.SoftBuildTime={{.time.utc}}' -X 'main.SoftCommit={{.commit}}' -X 'main.SoftVersion={{.version}}' -X 'main.SoftVersionCode={{.version_code}}'\" -o ./bin/gmake2_v{{.version}}_windows_arm64.exe"
]
get_info = [
"@echo Get version info...",
"@json https://1cp.org/gmake2.raw gmake2_version",
"@json parse gmake2_version version version",
"@json parse gmake2_version version_code version_code",
"@val commit git log --pretty=format:'%h' -1",
]