Repository navigation
Expand file tree
/
Copy pathTaskfile.yml
More file actions
83 lines (76 loc) · 2.58 KB
/
Copy pathTaskfile.yml
File metadata and controls
83 lines (76 loc) · 2.58 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
version: '3'
tasks:
build:
cmds:
- task: protos
- task: pipeline
# Generate protobuf code with buf (uses hosted remote plugins, so no local
# protoc / protoc-gen-* toolchain is required). Config: buf.gen.yaml.
protos:
desc: Generate protobuf code with buf
cmds:
- buf generate
- task: protos:post
# Post-generation: patch the ts-proto struct.ts WKT, add bson tags to the
# generated Go structs, and regenerate msgp code.
protos:post:
internal: true
cmds:
# TEMPORARY: works around a ts-proto struct.ts codegen bug (camelCase
# interface vs snake_case Value helpers). Drop this line and delete
# scripts/structpatch once the upstream ts-proto fix is merged and the
# pinned ts-proto version includes it. See scripts/structpatch/main.go.
- go run scripts/structpatch/main.go
- go run scripts/bsontags/main.go -dir ./pkg/model -verbose
- go run scripts/bsontags/main.go -dir ./backend/pkg/services/db -verbose
- go run scripts/bsontags/main.go -dir ./backend/pkg/services/share -verbose
- task: msgp
msgp:
cmd: go generate ./pkg/stats
pipeline:
desc: Run pipeline
vars:
CLI_ARGS: '{{.CLI_ARGS | default "run"}}'
cmds:
- go generate ./pipeline
- go run ./pipeline {{.CLI_ARGS}}
pipeline-add:
cmds:
- git add -v 'ui/packages/docs/docs/reference/*/*.md' > /dev/null
- git add -v '*.dm.*'
pipeline-clean:
cmds:
- git rm -f --ignore-unmatch 'ui/packages/docs/docs/reference/*/*.md' > /dev/null
- git rm -f --ignore-unmatch '*.dm.*'
enumer:
cmds:
- go generate ./pkg/core/attributes
wasm:
dir: cmd/wasm
cmds:
- go build -trimpath -o '{{.OUT | default "main.wasm"}}' -ldflags="-X 'main.shareKey=${{if eq OS "windows"}}env:{{end}}GCSIM_SHARE_KEY'"
- echo "compiled wasm successfully!"
env:
GOOS: js
GOARCH: wasm
lint:
desc: Run golangci-lint
cmd: golangci-lint run
lint-fix:
desc: Run golangci-lint and fix issues
cmd: golangci-lint run --fix
dev-server-mode:
desc: watches for change and launches server mode
watch: true
sources:
- '**/*.go'
vars:
WIN_CMD: Get-CimInstance -ClassName Win32_PRocess -Filter "CommandLine LIKE '%GCSIM_SERVER%'" | ForEach-Object -Process {taskkill /F /PID $_.ProcessId}
cmds:
- cmd: powershell {{shellQuote .WIN_CMD}}
platforms: [windows]
ignore_error: true
- cmd: pkill -f GCSIM_SERVER=1
platforms: [linux, darwin]
ignore_error: true
- go run cmd/server/main.go GCSIM_SERVER=1