Onboard boundary to use new version/VERSION file and reproducible actions-go-build (#2662)

* Onboard boundary to use new .release/VERSION file and reproducible actions-go-build

* Added automatic patch version bumps to end of release pipeline

* Added back VersionMetadata to internal directory

* Moved VERSION file to version/

* Update to current version

* Using prepare workflow for pre-stable channel workflow

* Test prepare workflow

* PR feedback: allow builds to run builds locally without setting BIN_PATH

* PR feedback: revert Enos changes

* PR Feedback

* Remove current branch from ci pipeline

* Run make fmt
This commit is contained in:
emily neil authored and GitHub committed 2022-12-09 13:08:02 -08:00
1 parent 5d48b10123
commit 7cd5b5a320
5 files changed
+129 -222

No files matched your search

+21 -9
View File
@@ -54,26 +54,38 @@ if [ "${CI_BUILD}x" != "x" ]; then
exit
fi
# Declare binary paths!
BINARY_NAME="boundary${BINARY_SUFFIX}"
BIN_PATH=${BIN_PATH:=bin/${BINARY_NAME}}
BIN_PARENT_DIR="${BIN_PATH%/*}"
BIN_PARENT_DIR="${BIN_PARENT_DIR##*/}"
# Delete the old dir
echo "==> Removing old directory..."
rm -f bin/*
mkdir -p bin/
echo "==> Removing old directory ${BIN_PARENT_DIR}..."
rm -rf ${BIN_PARENT_DIR}
mkdir -p ${BIN_PARENT_DIR}
# Build!
echo "==> Building into bin/ for ${GOOS}_${GOARCH}..."
BINARY_NAME="boundary${BINARY_SUFFIX}"
echo "==> Building into ${BIN_PARENT_DIR} for ${GOOS}_${GOARCH}..."
${GO_CMD} build \
-tags="${BUILD_TAGS}" \
-ldflags "-X github.com/hashicorp/boundary/version.GitCommit=${GIT_COMMIT}${GIT_DIRTY}" \
-o "bin/${BINARY_NAME}" \
-trimpath \
-buildvcs=false \
-ldflags "
-X github.com/hashicorp/boundary/version.GitCommit=${GIT_COMMIT}${GIT_DIRTY}
-X 'github.com/hashicorp/boundary/version.Version=$PRODUCT_VERSION'
-X 'github.com/hashicorp/boundary/version.VersionPrerelease=$PRERELEASE_PRODUCT_VERSION'
-X 'github.com/hashicorp/boundary/version.VersionMetadata=$METADATA_PRODUCT_VERSION'
" \
-o "$BIN_PATH" \
./cmd/boundary
# Copy binary into gopath if desired
if [ "${BOUNDARY_INSTALL_BINARY}x" != "x" ]; then
echo "==> Moving binary into GOPATH/bin..."
mv -f "bin/${BINARY_NAME}" "${GOPATH}/bin/"
mv -f "${BIN_PATH}" "${GOPATH}/bin/"
fi
# Done!
echo "==> Results:"
ls -hl bin/
ls -hl ${BIN_PARENT_DIR}