yr/justfile
Tim Hårek Andreassen 53981cae1d
build(just): Add install
Signed-off-by: Tim Hårek Andreassen <tim@harek.no>
2024-10-16 22:59:56 +02:00

38 lines
667 B
Makefile

builddir := "./build"
prefix := env_var_or_default("PREFIX", "/usr/local")
bindir := prefix + "/bin"
default:
just --list
dev +args='--help':
go run main.go {{args}}
test:
go test ./...
tidy:
go mod tidy
vet:
go vet ./...
clean:
rm -f build/*
rm -rf yr-*
rm -f yr-*.tar.gz
build:
go build -o {{builddir}}/
build-release tag version os arch:
GOOS="{{os}}" GOARCH="{{arch}}" just build
mkdir -p yr-{{version}}
cp {{builddir}}/yr* yr-{{version}}/
tar czf yr-{{version}}-{{os}}-{{arch}}.tar.gz yr-{{version}}
hut git artifact upload --rev {{tag}} yr-{{version}}-{{os}}-{{arch}}.tar.gz
install: build
install -m 0755 {{builddir}}/yr {{bindir}}