From 1de444510917d604679c185fa0104657f97e258e Mon Sep 17 00:00:00 2001 From: "m10x.de" Date: Sat, 25 Nov 2023 02:18:32 -0800 Subject: [PATCH] add script to compile the binaries for a release --- buildBinaries.sh | 55 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 buildBinaries.sh diff --git a/buildBinaries.sh b/buildBinaries.sh new file mode 100644 index 0000000..4d4608e --- /dev/null +++ b/buildBinaries.sh @@ -0,0 +1,55 @@ +#!/bin/bash +version=1.0.5 + +# Windows amd64 +goos=windows +goarch=amd64 +GOOS=$goos GOARCH=$goarch go build -o tinja.exe +zip build/TInjA_"$version"_"$goos"_"$goarch".zip tinja.exe + +# Linux amd64 +goos=linux +goarch=amd64 +GOOS=$goos GOARCH=$goarch go build -o tinja +tar cfvz build/TInjA_"$version"_"$goos"_"$goarch".tar.gz tinja + +# Linux arm64 +goos=linux +goarch=arm64 +GOOS=$goos GOARCH=$goarch go build -o tinja +tar cfvz build/TInjA_"$version"_"$goos"_"$goarch".tar.gz tinja + +# Darwin/MacOS amd64 +goos=darwin +goarch=amd64 +GOOS=$goos GOARCH=$goarch go build -o tinja +tar cfvz build/TInjA_"$version"_"$goos"_"$goarch".tar.gz tinja + +# Darwin/MacOS arm64 +goos=darwin +goarch=arm64 +GOOS=$goos GOARCH=$goarch go build -o tinja +tar cfvz build/TInjA_"$version"_"$goos"_"$goarch".tar.gz tinja + +# FreeBSD amd64 +goos=freebsd +goarch=amd64 +GOOS=$goos GOARCH=$goarch go build -o tinja +tar cfvz build/TInjA_"$version"_"$goos"_"$goarch".tar.gz tinja + +# OpenBSD amd64 +goos=openbsd +goarch=amd64 +GOOS=$goos GOARCH=$goarch go build -o tinja +tar cfvz build/TInjA_"$version"_"$goos"_"$goarch".tar.gz tinja + +# reset +GOOS= +GOARCH= + +# remove binaries +rm tinja +rm tinja.exe + +# generate checksum file +find build/ -type f \( -iname "*.tar.gz" -or -iname "*.zip" \) -exec sha256sum {} + > build/TInjA_"$version"_checksums_sha256.txt