Skip to content

Commit e2b8d8c

Browse files
Apple M1 support (#92)
* Enable Apple M1 support by adding darwin/arm64 to supported platforms. * Enable Apple M1 support by adding darwin/arm64 to homebrew tap script. * Fix if -> elif
1 parent 0163d37 commit e2b8d8c

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ GOARCH ?= amd64
1111
GOPROXY ?= "https://proxy.golang.org,direct"
1212
MAKEFILE_PATH = $(dir $(realpath -s $(firstword $(MAKEFILE_LIST))))
1313
BUILD_DIR_PATH = ${MAKEFILE_PATH}/build
14-
SUPPORTED_PLATFORMS ?= "windows/amd64,darwin/amd64,linux/amd64,linux/arm64,linux/arm"
14+
SUPPORTED_PLATFORMS ?= "windows/amd64,darwin/amd64,darwin/arm64,linux/amd64,linux/arm64,linux/arm"
1515
SELECTOR_PKG_VERSION_VAR=github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector.versionID
1616
LATEST_RELEASE_TAG=$(shell git describe --tags --abbrev=0)
1717
PREVIOUS_RELEASE_TAG=$(shell git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1`)

scripts/sync-to-aws-homebrew-tap

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ mkdir -p "${DOWNLOAD_DIR}" "${SYNC_DIR}" "${BREW_CONFIG_DIR}"
125125

126126
BASE_ASSET_URL="https://github.com/${REPO}/releases/download/${VERSION}/${BINARY_BASE}"
127127
MAC_HASH=""
128+
MAC_ARM64_HASH=""
128129
LINUX_HASH=""
129130
LINUX_ARM64_HASH=""
130131

@@ -160,8 +161,10 @@ for os_arch in "${PLATFORMS[@]}"; do
160161
fi
161162
fi
162163

163-
if [[ "${os}" == "darwin" ]]; then
164+
if [[ "${os}" == "darwin" && "${arch}" == "amd64" ]]; then
164165
MAC_HASH=$(hash_file "${asset_file_path}")
166+
elif [[ "${os}" == "darwin" && "${arch}" == "arm64" ]]; then
167+
MAC_ARM64_HASH=$(hash_file "${asset_file_path}")
165168
elif [[ "${os}" == "linux" && "${arch}" == "amd64" ]]; then
166169
LINUX_HASH=$(hash_file "${asset_file_path}")
167170
elif [[ "${os}" == "linux" && "${arch}" == "arm64" ]]; then
@@ -178,6 +181,7 @@ cat << EOM > "${BREW_CONFIG_DIR}/${BINARY_BASE}.json"
178181
"bottle": {
179182
"root_url": "${BASE_ASSET_URL}",
180183
"sha256": {
184+
"arm64_big_sur": "${MAC_ARM64_HASH}",
181185
"sierra": "${MAC_HASH}",
182186
"linux": "${LINUX_HASH}",
183187
"linux_arm": "${LINUX_ARM64_HASH}"
@@ -187,7 +191,7 @@ cat << EOM > "${BREW_CONFIG_DIR}/${BINARY_BASE}.json"
187191
EOM
188192

189193
if [[ "${DRY_RUN}" -eq 0 ]]; then
190-
if [[ -z "${MAC_HASH}" ]] && [[ -z "${LINUX_HASH}" ]] && [[ -z "${LINUX_ARM64_HASH}" ]]; then
194+
if [[ -z "${MAC_HASH}" ]] && [[ -z "${MAC_ARM64_HASH}" ]] && [[ -z "${LINUX_HASH}" ]] && [[ -z "${LINUX_ARM64_HASH}" ]]; then
191195
echo "❌ No hashes were calculated and dry-run is NOT engaged. Bailing out so we don't open a bad PR to the tap."
192196
exit 4
193197
fi

0 commit comments

Comments
 (0)