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