-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build homebrew bottles for Mac (arm64 and amd64)
- Loading branch information
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
# this script builds brew bottles but for Mac only (arm64 and amd64) | ||
# tarball name is like go-parquet-tools-1.22.0.arm64_monterey.bottle.tar.gz, | ||
# with content: | ||
# go-parquet-tools | ||
# └── 1.22.0 | ||
# ├── LICENSE | ||
# ├── README.md | ||
# └── bin | ||
# └── parquet-tools | ||
# | ||
|
||
SOURCE_DIR=${BUILD_DIR}/../ | ||
for ARCH in arm64 amd64; do | ||
ARCH_DIR=${BUILD_DIR}/brew/${ARCH}/ | ||
BOTTLE_DIR=${ARCH_DIR}/go-parquet-tools/${VERSION:1}/ | ||
mkdir -p ${BOTTLE_DIR}/bin | ||
|
||
# rebuild just in case we need any special setting for homebrew | ||
GOOS=darwin GOARCH=${ARCH} \ | ||
${GO} build ${GOFLAGS} -tags "${TAGS}" -ldflags "${LDFLAGS}" \ | ||
-o ${BOTTLE_DIR}/bin/parquet-tools ${SOURCE_DIR} | ||
|
||
# nice-to-have files | ||
cp ${SOURCE_DIR}/LICENSE ${BOTTLE_DIR}/ | ||
cp ${SOURCE_DIR}/README.md ${BOTTLE_DIR}/ | ||
|
||
# tarball | ||
tar zcf ${BUILD_DIR}/brew/${ARCH}.tar.gz -C ${ARCH_DIR} go-parquet-tools/ | ||
done | ||
|
||
for OSX in monterey sequoia sonoma ventura; do | ||
# for Apple Silicon | ||
cp ${BUILD_DIR}/brew/arm64.tar.gz \ | ||
${BUILD_DIR}/release/go-parquet-tools-${VERSION:1}.arm64_${OSX}.bottle.tar.gz | ||
|
||
# for Intel | ||
cp ${BUILD_DIR}/brew/amd64.tar.gz \ | ||
${BUILD_DIR}/release/go-parquet-tools-${VERSION:1}.${OSX}.bottle.tar.gz | ||
done |