q3rcon-proxy/Taskfile.yml

56 lines
1.2 KiB
YAML
Raw Normal View History

2025-02-03 18:25:39 +00:00
version: '3'
vars:
PROGRAM: q3rcon-proxy
SHELL: '{{if eq .OS "Windows_NT"}}powershell{{end}}'
BIN_DIR: bin
WINDOWS: '{{.BIN_DIR}}/{{.PROGRAM}}_windows_amd64.exe'
LINUX: '{{.BIN_DIR}}/{{.PROGRAM}}_linux_amd64'
GIT_COMMIT:
sh: git log -n 1 --format=%h
tasks:
default:
2025-02-07 23:19:05 +00:00
desc: Build the q3rcon-proxy project
cmds:
- task: build
2025-02-03 18:25:39 +00:00
build:
2025-02-07 23:19:05 +00:00
desc: Build the q3rcon-proxy project
deps: [vet]
cmds:
- task: build-windows
- task: build-linux
2025-02-03 18:25:39 +00:00
vet:
2025-02-07 23:19:05 +00:00
desc: Vet the code
2025-02-03 18:25:39 +00:00
deps: [fmt]
cmds:
- go vet ./...
fmt:
2025-02-07 23:19:05 +00:00
desc: Fmt the code
2025-02-03 18:25:39 +00:00
cmds:
- go fmt ./...
build-windows:
2025-02-07 23:19:05 +00:00
desc: Build the q3rcon-proxy project for Windows
2025-02-03 18:25:39 +00:00
cmds:
- GOOS=windows GOARCH=amd64 go build -o {{.WINDOWS}} -ldflags="-X main.Version={{.GIT_COMMIT}}" ./cmd/{{.PROGRAM}}/
build-linux:
2025-02-07 23:19:05 +00:00
desc: Build the q3rcon-proxy project for Linux
2025-02-03 18:25:39 +00:00
cmds:
- GOOS=linux GOARCH=amd64 go build -o {{.LINUX}} -ldflags="-X main.Version={{.GIT_COMMIT}}" ./cmd/{{.PROGRAM}}/
test:
2025-02-07 23:19:05 +00:00
desc: Run tests
2025-02-03 18:25:39 +00:00
cmds:
- go test ./...
clean:
2025-02-07 23:19:05 +00:00
desc: Clean the build artifacts
2025-02-03 18:25:39 +00:00
cmds:
2025-02-07 23:19:05 +00:00
- '{{.SHELL}} rm -r {{.BIN_DIR}}'