add builds for other architectures
continuous-integration/drone/tag Build is passing Details

This commit is contained in:
Wojciech Kwolek 2021-09-30 00:51:31 +02:00
parent 453d4097f7
commit 3be8afac3b
2 changed files with 20 additions and 2 deletions

View File

@ -6,7 +6,7 @@ steps:
- name: build and test - name: build and test
image: golang image: golang
commands: commands:
- go build - make all
- go test - go test
- name: gitea_release - name: gitea_release
image: plugins/gitea-release image: plugins/gitea-release
@ -15,7 +15,7 @@ steps:
from_secret: gitea_token from_secret: gitea_token
base_url: https://git.kwolek.io base_url: https://git.kwolek.io
files: files:
- autoupdate - dist/autoupdate*
when: when:
event: event:
- tag - tag

18
Makefile Normal file
View File

@ -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 $@