moving to Taskfile

This commit is contained in:
Bryson Steck 2025-07-11 18:23:57 -06:00
parent baad47e981
commit 441f030c4c
Signed by: bryson
SSH key fingerprint: SHA256:XpKABw/nP4z8UVaH+weLaBnEOD86+cVwif+QjuYLGT4
3 changed files with 34 additions and 1 deletions

31
Taskfile.yml Normal file
View file

@ -0,0 +1,31 @@
version: '3'
vars:
UNAME:
sh: uname
GOOS:
sh: go env GOOS
DOCKER_WINDOWS_EXE: C:/build/listen/listen.exe
DOCKER_EXE: /usr/src/listen/listen
tasks:
default:
deps:
- go-build
go-build:
cmds:
- "go build -o out/{{.GOOS}}/listen ."
precondition:
- "which go"
docker-build:
cmds:
- "docker build -t listen-build -f docker/build.$os.Dockerfile -e GOOS='{{.GOOS}}' ."
- "mkdir -p out/{{.GOOS}}"
- "docker create --name listen-build-tmp listen-build"
- "docker cp listen-build-tmp:{{.DOCKER_EXE}} out/{{.GOOS}}"
- "docker rm listen-build-tmp"
precondition:
- "which docker"
- "uname | grep -qe Linux -e MINGW"

View file

@ -5,6 +5,8 @@ ARG IMAGE="1-alpine"
FROM golang:${IMAGE} AS build
ENV GOOS="linux"
WORKDIR /usr/src/listen
COPY . .

View file

@ -13,7 +13,7 @@ import (
flags "github.com/jessevdk/go-flags"
)
const VERSION string = "v0.4.0"
const VERSION string = "v0.4.1"
type Options struct {
Version bool `short:"v" long:"version" description:"Displays version info and exits"`