-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
46 lines (44 loc) · 1.24 KB
/
Taskfile.yml
File metadata and controls
46 lines (44 loc) · 1.24 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
version: '3'
vars:
BINARY_NAME: advice-hub
OPENAI_TOKEN:
DEEPL_TOKEN:
REMOTE_ADDRESS:
REDIS_ADDR:
REDIS_PASSWORD:
PROXY_ADDR:
tasks:
clean:
cmds:
- rm -rf dist
- mkdir -p dist
build:
label: build-{{.TASK}}
cmds:
- |
GOOS={{.GOOS}} GOARCH={{.GOARCH}} GOARM={{.GOARM}} GOMIPS={{.GOMIPS}} \
CGO_ENABLED=0 \
go build -trimpath -o ./dist/{{.BINARY_NAME}} \
-ldflags "-X 'github.com/gtoxlili/advice-hub/constants.OpenAIToken={{.OPENAI_TOKEN}}' \
-X 'github.com/gtoxlili/advice-hub/constants.DeeplToken={{.DEEPL_TOKEN}}' \
-X 'github.com/gtoxlili/advice-hub/constants.RedisAddr={{.REDIS_ADDR}}' \
-X 'github.com/gtoxlili/advice-hub/constants.RedisPassword={{.REDIS_PASSWORD}}' \
-X 'github.com/gtoxlili/advice-hub/constants.ProxyAddr={{.PROXY_ADDR}}' \
-w -s -buildid="
# - scp -r ./dist/{{.BINARY_NAME}} {{.REMOTE_ADDRESS}}
build-frontend:
cmds:
- cd frontend && rm -rf dist && pnpm run build
linux-amd64:
cmds:
- task: build
vars: {
TASK: "{{.TASK}}",
GOOS: linux,
GOARCH: amd64
}
default:
cmds:
- task: clean
- task: build-frontend
- task: linux-amd64