Last active
November 9, 2022 14:03
-
-
Save 030/620a95e7a699c4db3e76b2b8b0309909 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
GITHUB_TAG="${GITHUB_TAG:-local}" | |
SHA512_CMD="${SHA512_CMD:-sha512sum}" | |
GO_BUILD_DIR="${1}" | |
GO_BUILD_DELIVERABLE="${2}" | |
echo "GITHUB_TAG: '${GITHUB_TAG}', SHA512_CMD: '${SHA512_CMD}', GO_BUILD_DIR: ${GO_BUILD_DIR}, GO_BUILD_DELIVERABLE: '${GO_BUILD_DELIVERABLE}'" | |
cd cmd/${GO_BUILD_DIR} | |
go build -buildvcs=false -ldflags "-X main.Version=${GITHUB_TAG}" -o "${GO_BUILD_DELIVERABLE}" | |
$SHA512_CMD "${GO_BUILD_DELIVERABLE}" >"${GO_BUILD_DELIVERABLE}.sha512.txt" | |
chmod +x "${GO_BUILD_DELIVERABLE}" | |
cd ../.. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment