Skip to content

Commit

Permalink
CUS-356: release macos / x64 binaries (#41)
Browse files Browse the repository at this point in the history
Needed for our macOS / x64 CI machines.
  • Loading branch information
jayconrod authored Aug 23, 2024
1 parent d29b577 commit ac42ea1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ filegroup(
srcs = [
"//cmd/engflow_auth:engflow_auth_linux_x64",
"//cmd/engflow_auth:engflow_auth_macos_arm64",
"//cmd/engflow_auth:engflow_auth_macos_x64",
"//cmd/engflow_auth:engflow_auth_windows_x64",
],
)
7 changes: 7 additions & 0 deletions cmd/engflow_auth/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ go_cross_binary(
visibility = RELEASE_ARTIFACT,
)

go_cross_binary(
name = "engflow_auth_macos_x64",
platform = "@rules_go//go/toolchain:darwin_amd64_cgo",
target = ":engflow_auth",
visibility = RELEASE_ARTIFACT,
)

go_cross_binary(
name = "engflow_auth_windows_x64",
platform = "@rules_go//go/toolchain:windows_amd64_cgo",
Expand Down
9 changes: 7 additions & 2 deletions infra/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if [[ "$#" -ne 1 ]]; then
fi

# Taken from https://semver.org/, with a `v` prepended
readonly SEMVER_REGEX='^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$'
readonly SEMVER_REGEX='^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-((0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$'
readonly RELEASE_VERSION="$1"
readonly GH_CLI_URL='https://storage.googleapis.com/engflow-tools-public/github.com/cli/cli/releases/download/v2.52.0/gh_2.52.0_linux_amd64.tar.gz'
readonly GH_CLI_EXPECTED_SHA256='3ea6ed8b2585f406a064cecd7e1501e58f56c8e7ca764ae1f3483d1b8ed68826'
Expand Down Expand Up @@ -67,7 +67,7 @@ echo "[FINISH] Downloading gh CLI"

echo "[START] Release branch checks"
# Current commit must be on either `main` or the corresponding release branch
readonly EXPECTED_RELEASE_BRANCH="$(sed --regexp-extended 's|(v[0-9]+.[0-9]+).[0-9]+|release/\1|' <<<${RELEASE_VERSION})"
readonly EXPECTED_RELEASE_BRANCH="$(sed --regexp-extended 's|(^v[0-9]+\.[0-9]+)\..*$|release/\1|' <<<${RELEASE_VERSION})"
if ! git branch \
--contains "$(git rev-parse HEAD)" \
| grep --quiet --extended-regexp "main|${EXPECTED_RELEASE_BRANCH}"; then
Expand Down Expand Up @@ -105,6 +105,10 @@ cp \
bazel-out/k8-fastbuild-ST-*/bin/cmd/engflow_auth/engflow_auth_macos_arm64 \
"${ARTIFACTS_DIR}/engflow_auth_macos_arm64"

cp \
bazel-out/k8-fastbuild-ST-*/bin/cmd/engflow_auth/engflow_auth_macos_x64 \
"${ARTIFACTS_DIR}/engflow_auth_macos_x64"

cp \
bazel-out/k8-fastbuild-ST-*/bin/cmd/engflow_auth/engflow_auth_windows_x64 \
"${ARTIFACTS_DIR}/engflow_auth_windows_x64"
Expand All @@ -117,5 +121,6 @@ ${GH_CLI} release create \
--generate-notes \
"${ARTIFACTS_DIR}/engflow_auth_linux_x64#engflow_auth (Linux, x64)" \
"${ARTIFACTS_DIR}/engflow_auth_macos_arm64#engflow_auth (macOS, arm64)" \
"${ARTIFACTS_DIR}/engflow_auth_macos_x64#engflow_auth (macOS, x64)" \
"${ARTIFACTS_DIR}/engflow_auth_windows_x64#engflow_auth (Windows, x64)"
echo "[FINISH] Creating release"

0 comments on commit ac42ea1

Please sign in to comment.