-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·31 lines (25 loc) · 1.01 KB
/
release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
# From everything I have found it doesn't look like you can do a bazel build with
# multiple different platforms in one invocation. If that changes we can remove
# this but for now to cut a release you can just run this script.
# gopkg.in/src-d/go-git.v4 v4.8.1 doesn't build on solaris_amd64
builds=(
"openbsd_amd64"
"netbsd_amd64"
"linux_amd64"
"freebsd_amd64"
"darwin_amd64")
releases="release/$(git describe --tags)"
mkdir -p ${releases}
for arch in "${builds[@]}"; do
echo build for $arch
echo ===========================================================================
bazel build \
--@io_bazel_rules_go//go/config:static \
--platform_suffix=_$arch \
--platforms=@io_bazel_rules_go//go/toolchain:$arch \
//:git-sync
# Not sure how to fix but bazel decided to change this path to something stupid instead of providing
# an easy way to find builds for different platforms.
cp -f $(pwd)/bazel-out/darwin-fastbuild_$arch-*/bin/git-sync_/git-sync $(pwd)/${releases}/git-sync_$arch
done