Skip to content

Commit

Permalink
github: fix release script
Browse files Browse the repository at this point in the history
  • Loading branch information
mgred committed Jun 23, 2023
1 parent deb0ee5 commit c1d6ac2
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions .github/workflows/create_assets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,22 @@

version=$@

echo "Create assets for $version"
function build_and_pack()
{
GOOS=$1 GOARCH=$2 go build -v github.com/bzlparty/tool-versions-generator/cmd/tvg
if [[ "$1" == "windows" ]]; then
zip "tvg-${version}-${1}_${2}.zip" tvg.exe LICENSE README.md
rm tvg.exe
else
tar cvf "tvg-${version}-${1}_${2}.tar.gz" tvg LICENSE README.md
rm tvg
fi
}

for os in darwin linux windows; do
for arch in amd64 386; do
echo "Build $os $arch"
GOOS=$o GOARCH=$a go build -v github.com/bzlparty/tool-versions-generator/cmd/tvg
echo "Create assets for $version"

if [[ "$os" == "windows" ]]; then
zip tvg-$version-$os_$arch.zip tvg.exe LICENSE README.md
rm tvg.exe
else
tar cvf tvg-$version-$os_$arch.tar.gz tvg LICENSE README.md
rm tvg
fi
done
done
build_and_pack linux amd64
build_and_pack linux 386
build_and_pack darwin amd64
build_and_pack windows amd64
build_and_pack windows 386

0 comments on commit c1d6ac2

Please sign in to comment.