Skip to content

Commit

Permalink
ci: remove version from generated binary names and adjust architecture
Browse files Browse the repository at this point in the history
We need to to use the pattern `OS-ARCHITECTURE[EXTENSION]` for gh to recognize the binaries
  • Loading branch information
hielfx committed Feb 13, 2024
1 parent 38e2965 commit 466be33
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,8 @@ set -e

NAME="gh-sherpa"
ROOT_DIR="$(dirname "$0")"
VERSION=$(head -1 "${ROOT_DIR}/version")
DIST_DIR="${ROOT_DIR}/dist"

if [ "${VERSION}" == "" ]; then
echo "Version is required."
exit 1
fi

# Build distributable files of the extension.
rm -rf "${DIST_DIR}"
echo "==> Building distributables for the supported architectures..."
Expand All @@ -19,25 +13,25 @@ echo "==> Building distributables for the supported architectures..."
export CGO_ENABLED=0

# MacOS
echo "-> MacOS x86_64"
GOOS=darwin GOARCH=amd64 go build -o "dist/${NAME}-darwin-x86_64-${VERSION}"
echo "-> MacOS amd64"
GOOS=darwin GOARCH=amd64 go build -o "dist/${NAME}-darwin-amd64"
echo "-> MacOS arm64"
GOOS=darwin GOARCH=arm64 go build -o "dist/${NAME}-darwin-arm64-${VERSION}"
GOOS=darwin GOARCH=arm64 go build -o "dist/${NAME}-darwin-arm64"

#Linux
echo "-> Linux i386"
GOOS=linux GOARCH=386 go build -o "dist/${NAME}-linux-i386-${VERSION}"
echo "-> Linux x86_64"
GOOS=linux GOARCH=amd64 go build -o "dist/${NAME}-linux-x86_64-${VERSION}"
GOOS=linux GOARCH=386 go build -o "dist/${NAME}-linux-386"
echo "-> Linux amd64"
GOOS=linux GOARCH=amd64 go build -o "dist/${NAME}-linux-amd64"
echo "-> Linux arm64"
GOOS=linux GOARCH=arm64 go build -o "dist/${NAME}-linux-arm64-${VERSION}"
GOOS=linux GOARCH=arm64 go build -o "dist/${NAME}-linux-arm64"

# Windows
echo "-> Windows i386"
GOOS=windows GOARCH=386 go build -o "dist/${NAME}-windows-i386-${VERSION}.exe"
echo "-> Windows x86_64"
GOOS=windows GOARCH=amd64 go build -o "dist/${NAME}-windows-x86_64-${VERSION}.exe"
GOOS=windows GOARCH=386 go build -o "dist/${NAME}-windows-386.exe"
echo "-> Windows amd64"
GOOS=windows GOARCH=amd64 go build -o "dist/${NAME}-windows-amd64.exe"
echo "-> Windows arm64"
GOOS=windows GOARCH=amd64 go build -o "dist/${NAME}-windows-arm64-${VERSION}.exe"
GOOS=windows GOARCH=arm64 go build -o "dist/${NAME}-windows-arm64.exe"

echo "==> Done!"

0 comments on commit 466be33

Please sign in to comment.