52 lines
1.1 KiB
YAML
52 lines
1.1 KiB
YAML
# https://taskfile.dev
|
|
|
|
version: '3'
|
|
|
|
tasks:
|
|
test:
|
|
cmds:
|
|
- go test -v ./...
|
|
silent: true
|
|
desc: Run unit tests
|
|
clean:
|
|
cmds:
|
|
- go clean
|
|
- rm -rf ./bin
|
|
silent: true
|
|
desc: Remove build artifacts and clean up
|
|
build:
|
|
env:
|
|
VERSION: '{{.VERSION | default "0.0.0"}}'
|
|
cmds:
|
|
- go build -ldflags "-X main.Version=${VERSION}" -o ./bin/gsquash ./main.go
|
|
silent: true
|
|
package:
|
|
deps:
|
|
- build
|
|
cmds:
|
|
- mkdir -p ./dist
|
|
- tar -czvf ./dist/gsquash.tar.gz ./bin/gsquash
|
|
silent: true
|
|
desc: Package the binary into a tarball
|
|
install:
|
|
deps:
|
|
- build
|
|
cmds:
|
|
- cmd: sudo cp ./bin/gsquash /usr/local/bin/gsquash
|
|
platforms:
|
|
- darwin
|
|
- linux
|
|
- cmd: |
|
|
cp ./bin/gsquash.exe /Program Files(x86)/gsquash/gsquash.exe
|
|
setx PATH "%PATH%;C:\Program Files(x86)\gsquash"
|
|
platforms:
|
|
- windows
|
|
silent: true
|
|
desc: Install the binary into /usr/local/bin
|
|
default:
|
|
deps:
|
|
- test
|
|
- clean
|
|
- build
|
|
silent: true
|
|
desc: Run tests, clean up and build |