Skip to content

Commit

Permalink
Release binaries for linux-arm64 architecture (#957)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladmos authored Feb 8, 2021
1 parent 055ae62 commit 752270c
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 2 deletions.
10 changes: 10 additions & 0 deletions buildifier/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ go_binary(
visibility = ["//visibility:public"],
)

go_binary(
name = "buildifier-linux-arm64",
out = "buildifier-linux_arm64",
embed = [":go_default_library"],
goarch = "arm64",
goos = "linux",
pure = "on",
visibility = ["//visibility:public"],
)

# Test that the buildifier binary works
sh_test(
name = "buildifier_integration_test",
Expand Down
3 changes: 2 additions & 1 deletion buildifier/npm/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ _PARENT_PACKAGE_FILES = [
"README.md",
"buildifier-darwin_amd64",
"buildifier-linux_amd64",
"buildifier-linux_arm64",
"buildifier-windows_amd64.exe",
]

Expand All @@ -31,7 +32,7 @@ _PARENT_PACKAGE_FILES = [
# go_binary doesn't give a predeclared output for
# the file in "out" so we have to construct a
# label to reference the go_binary rule itself.
src = "//buildifier:%s" % s.split("_")[0],
src = "//buildifier:%s" % s.replace("_arm64", "-arm64").split("_amd64")[0],
out = s,
)
for s in _PARENT_PACKAGE_FILES
Expand Down
10 changes: 10 additions & 0 deletions buildozer/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ go_binary(
visibility = ["//visibility:public"],
)

go_binary(
name = "buildozer-linux-arm64",
out = "buildozer-linux_arm64",
embed = [":go_default_library"],
goarch = "arm64",
goos = "linux",
pure = "on",
visibility = ["//visibility:public"],
)

exports_files(
[
"README.md",
Expand Down
3 changes: 2 additions & 1 deletion buildozer/npm/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ _PARENT_PACKAGE_FILES = [
"README.md",
"buildozer-darwin_amd64",
"buildozer-linux_amd64",
"buildozer-linux_arm64",
"buildozer-windows_amd64.exe",
]

Expand All @@ -51,7 +52,7 @@ _PARENT_PACKAGE_FILES = [
# go_binary doesn't give a predeclared output for
# the file in "out" so we have to construct a
# label to reference the go_binary rule itself.
src = "//buildozer:%s" % s.split("_")[0],
src = "//buildozer:%s" % s.replace("_arm64", "-arm64").split("_amd64")[0],
out = s,
)
for s in _PARENT_PACKAGE_FILES
Expand Down
2 changes: 2 additions & 0 deletions release/github.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ bazel build --config=release //buildifier:all //buildozer:all //unused_deps:all

for tool in "buildifier" "buildozer" "unused_deps"; do
cp bazel-out/*-opt-*/bin/"$tool/$tool-linux_amd64" $BIN_DIR
cp bazel-out/*-opt-*/bin/"$tool/$tool-linux_arm64" $BIN_DIR
cp bazel-out/*-opt-*/bin/"$tool/$tool-darwin_amd64" $BIN_DIR
cp bazel-out/*-opt-*/bin/"$tool/$tool-windows_amd64.exe" $BIN_DIR
done;
Expand All @@ -40,6 +41,7 @@ upload_file() {

for tool in "buildifier" "buildozer" "unused_deps"; do
upload_file "$BIN_DIR/$tool-linux_amd64" "$tool-linux-amd64"
upload_file "$BIN_DIR/$tool-linux_arm64" "$tool-linux-arm64"
upload_file "$BIN_DIR/$tool-darwin_amd64" "$tool-darwin-amd64"
upload_file "$BIN_DIR/$tool-windows_amd64.exe" "$tool-windows-amd64.exe"
done
Expand Down
10 changes: 10 additions & 0 deletions unused_deps/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ go_binary(
visibility = ["//visibility:public"],
)

go_binary(
name = "unused_deps-linux-arm64",
out = "unused_deps-linux_arm64",
embed = [":go_default_library"],
goarch = "arm64",
goos = "linux",
pure = "on",
visibility = ["//visibility:public"],
)

go_test(
name = "jar_manifest_test",
size = "small",
Expand Down

0 comments on commit 752270c

Please sign in to comment.