File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
33set -e
4+ REPO_ROOT=$( git rev-parse --show-toplevel)
45
5- go build -o ./bin/aoc-cli ./cmd/*
6+ VERSION=$( git describe --tags " $( git rev-list --tags --max-count=1) " ) " -local"
7+ COMMIT_HASH=$( git rev-parse --short HEAD 2> /dev/null)
8+ DATE=$( date " +%Y-%m-%d" )
9+ GOVERSION=$( go version | awk ' {print $3;}' )
10+ GO_BUILD_LDFLAGS=" -s -w -X 'main.commit=${COMMIT_HASH} ' -X 'main.date=${DATE} ' -X 'main.version=${VERSION} ' -X 'main.goversion=${GOVERSION} '"
11+
12+ APP=" aoc-cli"
13+ MODULE=" github.com/oleg-balunenko/advent-of-code"
14+
15+ GO_BUILD_PACKAGE=" ${MODULE} /cmd/aoc-cli/."
16+
17+ BIN_DIR=" ${REPO_ROOT} /bin"
18+ rm -rf " ${BIN_DIR} "
19+ mkdir -p " ${BIN_DIR} "
20+
21+ go build -o " ${BIN_DIR} " /" ${APP} " -a -ldflags " ${GO_BUILD_LDFLAGS} " " ${GO_BUILD_PACKAGE} "
You can’t perform that action at this time.
0 commit comments