Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CUS-356: release: add linux/arm64 binary #46

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ gazelle(name = "gazelle")
filegroup(
name = "release_artifacts",
srcs = [
"//cmd/engflow_auth:engflow_auth_linux_arm64",
"//cmd/engflow_auth:engflow_auth_linux_x64",
"//cmd/engflow_auth:engflow_auth_macos_arm64",
"//cmd/engflow_auth:engflow_auth_macos_x64",
Expand Down
7 changes: 7 additions & 0 deletions cmd/engflow_auth/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,10 @@ go_cross_binary(
target = ":engflow_auth",
visibility = RELEASE_ARTIFACT,
)

go_cross_binary(
name = "engflow_auth_linux_arm64",
platform = "@rules_go//go/toolchain:linux_arm64_cgo",
target = ":engflow_auth",
visibility = RELEASE_ARTIFACT,
)
23 changes: 16 additions & 7 deletions infra/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,18 @@ if [[ "${GH_CLI_ACTUAL_SHA256}" != "${GH_CLI_EXPECTED_SHA256}" ]]; then
fi
echo "[FINISH] Downloading gh CLI"

# If this is a release version (not a prerelease), the commit must be on main or
# the correct release branch (e.g., release/v1.2). This constraint doesn't apply
# to prereleases so we can test this workflow.
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]+)\..*$|release/\1|' <<<${RELEASE_VERSION})"
if ! git branch \
--contains "$(git rev-parse HEAD)" \
| grep --quiet --extended-regexp "main|${EXPECTED_RELEASE_BRANCH}"; then
echo "Commit $(git rev-parse HEAD) is not on main or release branch ${EXPECTED_RELEASE_BRANCH}; exiting"
exit 1
if [[ "${RELEASE_VERSION}" != *-* ]]; then
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
echo "Commit $(git rev-parse HEAD) is not on main or release branch ${EXPECTED_RELEASE_BRANCH}; exiting"
exit 1
fi
fi
echo "[FINISH] Release branch checks"

Expand All @@ -97,6 +101,10 @@ echo "[FINISH] Building artifacts"
# resolution, we may be able to drop this staging step and the corresponding
# temp dir.
echo "[START] Staging artifacts"
cp \
bazel-out/k8-fastbuild-ST-*/bin/cmd/engflow_auth/engflow_auth_linux_arm64 \
"${ARTIFACTS_DIR}/engflow_auth_linux_arm64"

cp \
bazel-out/k8-fastbuild-ST-*/bin/cmd/engflow_auth/engflow_auth_linux_x64 \
"${ARTIFACTS_DIR}/engflow_auth_linux_x64"
Expand All @@ -119,6 +127,7 @@ echo "[START] Creating release"
${GH_CLI} release create \
"${RELEASE_VERSION}" \
--generate-notes \
"${ARTIFACTS_DIR}/engflow_auth_linux_arm64#engflow_auth (Linux, arm64)" \
"${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)" \
Expand Down