feat #11: release hrp cli binaries automatically with github actions

feat #20: add Makefile for running unittest and building hrp cli binary
This commit is contained in:
debugtalk
2021-11-19 15:22:46 +08:00
parent 95d0c5d951
commit 48e26354a7
9 changed files with 83 additions and 7 deletions

23
hrp/scripts/build.sh Normal file
View File

@@ -0,0 +1,23 @@
#!/bin/bash
# build hrp cli binary for testing
# release will be triggered on github actions, see .github/workflows/release.yml
# Usage:
# $ make build
# or
# $ bash hrp/scripts/build.sh
set -e
set -x
# prepare path
mkdir -p "output"
bin_path="output/hrp"
# build
go build -ldflags '-s -w' -o "$bin_path" hrp/main.go
# check output and version
ls -lh "$bin_path"
chmod +x "$bin_path"
./"$bin_path" -v