mirror of
https://github.com/onyx-and-iris/q3rcon-proxy.git
synced 2025-02-22 17:55:13 +00:00
56 lines
1.2 KiB
YAML
56 lines
1.2 KiB
YAML
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:
|
|
desc: Build the q3rcon-proxy project
|
|
cmds:
|
|
- task: build
|
|
|
|
build:
|
|
desc: Build the q3rcon-proxy project
|
|
deps: [vet]
|
|
cmds:
|
|
- task: build-windows
|
|
- task: build-linux
|
|
|
|
vet:
|
|
desc: Vet the code
|
|
deps: [fmt]
|
|
cmds:
|
|
- go vet ./...
|
|
|
|
fmt:
|
|
desc: Fmt the code
|
|
cmds:
|
|
- go fmt ./...
|
|
|
|
build-windows:
|
|
desc: Build the q3rcon-proxy project for Windows
|
|
cmds:
|
|
- GOOS=windows GOARCH=amd64 go build -o {{.WINDOWS}} -ldflags="-X main.Version={{.GIT_COMMIT}}" ./cmd/{{.PROGRAM}}/
|
|
|
|
build-linux:
|
|
desc: Build the q3rcon-proxy project for Linux
|
|
cmds:
|
|
- GOOS=linux GOARCH=amd64 go build -o {{.LINUX}} -ldflags="-X main.Version={{.GIT_COMMIT}}" ./cmd/{{.PROGRAM}}/
|
|
|
|
test:
|
|
desc: Run tests
|
|
cmds:
|
|
- go test ./...
|
|
|
|
clean:
|
|
desc: Clean the build artifacts
|
|
cmds:
|
|
- '{{.SHELL}} rm -r {{.BIN_DIR}}'
|