Skip to content

Commit cd40f05

Browse files
authored
CUS-356: release: add linux/arm64 binary (#46)
Also, allow prerelease versions outside release branches so we can manually test changes to this script.
1 parent bab0014 commit cd40f05

File tree

3 files changed

+24
-7
lines changed

3 files changed

+24
-7
lines changed

BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ gazelle(name = "gazelle")
66
filegroup(
77
name = "release_artifacts",
88
srcs = [
9+
"//cmd/engflow_auth:engflow_auth_linux_arm64",
910
"//cmd/engflow_auth:engflow_auth_linux_x64",
1011
"//cmd/engflow_auth:engflow_auth_macos_arm64",
1112
"//cmd/engflow_auth:engflow_auth_macos_x64",

cmd/engflow_auth/BUILD

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,10 @@ go_cross_binary(
6666
target = ":engflow_auth",
6767
visibility = RELEASE_ARTIFACT,
6868
)
69+
70+
go_cross_binary(
71+
name = "engflow_auth_linux_arm64",
72+
platform = "@rules_go//go/toolchain:linux_arm64_cgo",
73+
target = ":engflow_auth",
74+
visibility = RELEASE_ARTIFACT,
75+
)

infra/release.sh

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,18 @@ if [[ "${GH_CLI_ACTUAL_SHA256}" != "${GH_CLI_EXPECTED_SHA256}" ]]; then
6565
fi
6666
echo "[FINISH] Downloading gh CLI"
6767

68+
# If this is a release version (not a prerelease), the commit must be on main or
69+
# the correct release branch (e.g., release/v1.2). This constraint doesn't apply
70+
# to prereleases so we can test this workflow.
6871
echo "[START] Release branch checks"
69-
# Current commit must be on either `main` or the corresponding release branch
70-
readonly EXPECTED_RELEASE_BRANCH="$(sed --regexp-extended 's|(^v[0-9]+\.[0-9]+)\..*$|release/\1|' <<<${RELEASE_VERSION})"
71-
if ! git branch \
72-
--contains "$(git rev-parse HEAD)" \
73-
| grep --quiet --extended-regexp "main|${EXPECTED_RELEASE_BRANCH}"; then
74-
echo "Commit $(git rev-parse HEAD) is not on main or release branch ${EXPECTED_RELEASE_BRANCH}; exiting"
75-
exit 1
72+
if [[ "${RELEASE_VERSION}" != *-* ]]; then
73+
readonly EXPECTED_RELEASE_BRANCH="$(sed --regexp-extended 's|(^v[0-9]+\.[0-9]+)\..*$|release/\1|' <<<${RELEASE_VERSION})"
74+
if ! git branch \
75+
--contains "$(git rev-parse HEAD)" \
76+
| grep --quiet --extended-regexp "main|${EXPECTED_RELEASE_BRANCH}"; then
77+
echo "Commit $(git rev-parse HEAD) is not on main or release branch ${EXPECTED_RELEASE_BRANCH}; exiting"
78+
exit 1
79+
fi
7680
fi
7781
echo "[FINISH] Release branch checks"
7882

@@ -97,6 +101,10 @@ echo "[FINISH] Building artifacts"
97101
# resolution, we may be able to drop this staging step and the corresponding
98102
# temp dir.
99103
echo "[START] Staging artifacts"
104+
cp \
105+
bazel-out/k8-fastbuild-ST-*/bin/cmd/engflow_auth/engflow_auth_linux_arm64 \
106+
"${ARTIFACTS_DIR}/engflow_auth_linux_arm64"
107+
100108
cp \
101109
bazel-out/k8-fastbuild-ST-*/bin/cmd/engflow_auth/engflow_auth_linux_x64 \
102110
"${ARTIFACTS_DIR}/engflow_auth_linux_x64"
@@ -119,6 +127,7 @@ echo "[START] Creating release"
119127
${GH_CLI} release create \
120128
"${RELEASE_VERSION}" \
121129
--generate-notes \
130+
"${ARTIFACTS_DIR}/engflow_auth_linux_arm64#engflow_auth (Linux, arm64)" \
122131
"${ARTIFACTS_DIR}/engflow_auth_linux_x64#engflow_auth (Linux, x64)" \
123132
"${ARTIFACTS_DIR}/engflow_auth_macos_arm64#engflow_auth (macOS, arm64)" \
124133
"${ARTIFACTS_DIR}/engflow_auth_macos_x64#engflow_auth (macOS, x64)" \

0 commit comments

Comments
 (0)