Skip to content

Commit

Permalink
add script to compile the binaries for a release
Browse files Browse the repository at this point in the history
  • Loading branch information
m10x authored Nov 25, 2023
1 parent 926e810 commit 1de4445
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions buildBinaries.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1de4445

Please sign in to comment.