diff --git a/.drone.yml b/.drone.yml index 61f1dfd..a72421e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -6,7 +6,7 @@ steps: - name: build and test image: golang commands: - - go build + - make all - go test - name: gitea_release image: plugins/gitea-release @@ -15,7 +15,7 @@ steps: from_secret: gitea_token base_url: https://git.kwolek.io files: - - autoupdate + - dist/autoupdate* when: event: - tag diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..7b47513 --- /dev/null +++ b/Makefile @@ -0,0 +1,18 @@ + + +.PHONY: all linux darwin freebsd clean +all: linux darwin freebsd + +linux: $(addprefix dist/autoupdate.linux.,amd64 arm64) +darwin: $(addprefix dist/autoupdate.darwin.,arm64 amd64) +freebsd: $(addprefix dist/autoupdate.freebsd.,amd64 arm) + +clean: + rm -rf dist + +dist/autoupdate.%: *.go go.mod go.sum + $(eval platform := $(subst ., ,$@)) + $(eval os := $(word 2,$(platform))) + $(eval arch := $(word 3,$(platform))) + GOOS=$(os) GOARCH=$(arch) go build -o $@ +