File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -e
4+
5+ VERSION=$( git describe --tags --exact-match)
6+ COMMIT=$( git rev-parse --short HEAD)
7+ DATE=$( date -u +" %Y-%m-%dT%H:%M:%SZ" )
8+
9+ mkdir -p dist
10+
11+ echo " Building ${VERSION} "
12+
13+ GOOS=linux GOARCH=amd64 \
14+ go build \
15+ -ldflags=" -s -w \
16+ -X 'github.com/aasixh/devgrep/cmd.Version=${VERSION} ' \
17+ -X 'github.com/aasixh/devgrep/cmd.Commit=${COMMIT} ' \
18+ -X 'github.com/aasixh/devgrep/cmd.Date=${DATE} '" \
19+ -o dist/devgrep-linux-amd64 .
20+
21+ GOOS=windows GOARCH=amd64 \
22+ go build \
23+ -ldflags=" -s -w \
24+ -X 'github.com/aasixh/devgrep/cmd.Version=${VERSION} ' \
25+ -X 'github.com/aasixh/devgrep/cmd.Commit=${COMMIT} ' \
26+ -X 'github.com/aasixh/devgrep/cmd.Date=${DATE} '" \
27+ -o dist/devgrep-windows-amd64.exe .
28+
29+ GOOS=darwin GOARCH=amd64 \
30+ go build \
31+ -ldflags=" -s -w \
32+ -X 'github.com/aasixh/devgrep/cmd.Version=${VERSION} ' \
33+ -X 'github.com/aasixh/devgrep/cmd.Commit=${COMMIT} ' \
34+ -X 'github.com/aasixh/devgrep/cmd.Date=${DATE} '" \
35+ -o dist/devgrep-darwin-amd64 .
36+
37+ GOOS=darwin GOARCH=arm64 \
38+ go build \
39+ -ldflags=" -s -w \
40+ -X 'github.com/aasixh/devgrep/cmd.Version=${VERSION} ' \
41+ -X 'github.com/aasixh/devgrep/cmd.Commit=${COMMIT} ' \
42+ -X 'github.com/aasixh/devgrep/cmd.Date=${DATE} '" \
43+ -o dist/devgrep-darwin-arm64 .
44+
45+ echo " Done."
You can’t perform that action at this time.
0 commit comments