chore: add local build helpers

Этот коммит содержится в:
2021-09-17 11:09:53 +02:00
родитель 2ad1595a34
Коммит fb981c5df9
3 изменённых файлов: 26 добавлений и 0 удалений

1
.gitignore поставляемый Обычный файл
Просмотреть файл

@ -0,0 +1 @@
/bin

4
Makefile Обычный файл
Просмотреть файл

@ -0,0 +1,4 @@
build:
misc/script/build
.PHONY: build

21
misc/script/build Исполняемый файл
Просмотреть файл

@ -0,0 +1,21 @@
#!/bin/bash
set -e
DISTS=${DISTS:-linux/386 linux/amd64 windows/amd64 darwin/amd64}
for dist in $DISTS
do
os=`echo $dist | cut -d'/' -f1`
arch=`echo $dist | cut -d'/' -f2`
env GOOS=$os GOARCH=$arch go build -o bin/werther_${os}_${arch} -ldflags "-w -s -X main.version=$(git describe --tags)" ./cmd/werther
if [[ "$os" = "windows" ]]; then
zip -r bin/werther_${os}_${arch}.zip bin/werther_${os}_${arch}
else
tar cvzf bin/werther_${os}_${arch}.tar.gz bin/werther_${os}_${arch}
fi
done
(cd bin && sha256sum *.{tar.gz,zip} > werther_checksums.txt)