From 5d39ed139ca52db22d920f2cb2e87b5f5f1ef9ff Mon Sep 17 00:00:00 2001 From: AlexSSD7 Date: Mon, 4 Sep 2023 09:37:12 +0100 Subject: [PATCH] Create build-binaries.sh --- .gitignore | 3 ++- build-binaries.sh | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 build-binaries.sh diff --git a/.gitignore b/.gitignore index c4ba37a..1c6d5b2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ linsk linsk.exe *.qcow2 -bin/ \ No newline at end of file +bin/ +build/ \ No newline at end of file diff --git a/build-binaries.sh b/build-binaries.sh new file mode 100644 index 0000000..82b26e6 --- /dev/null +++ b/build-binaries.sh @@ -0,0 +1,32 @@ +rm -rf build +mkdir build + +trimpath=$PWD +echo "Trimming path $trimpath" + +version=$1 + +if [ -z "$version" ]; then + echo "Version is not specified (first positional argument)" + exit 1 +fi + +function build() { + file_name="linsk_${1}_${2}_${version}" + CGO_ENABLED=0 GOOS=$1 GOARCH=$2 go build -trimpath -o build/$file_name + cd build + zip $file_name.zip $file_name + rm $file_name + cd .. +} + +build windows amd64 +build darwin amd64 +build darwin arm64 + +cd build + +hashes_file="linsk_sha256_$version.txt" + +sha256sum * > $hashes_file +gpg --output ${hashes_file}.sig --detach-sign --armor $hashes_file \ No newline at end of file