Skip to content

Commit

Permalink
Fixing release workflow, and adding -i option to build.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
kenshaw committed Nov 10, 2023
1 parent dd8ad1a commit ea8b3ab
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,6 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
draft: true
generate_release_notes: true
files: dist-*/*/*/*.{bz2,zip}
files: |
dist-*/*/*/*.bz2
dist-*/*/*/*.zip
17 changes: 14 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ BUILD=$SRC/build
STATIC=0
FORCE=0
CHECK=1
INSTALL=0
VERBOSE=false
PLATFORM=$(go env GOOS)
ARCH=$(go env GOARCH)
GOARCH=$ARCH

OPTIND=1
while getopts "a:b:v:sfrnx" opt; do
while getopts "a:b:v:sfrnxi" opt; do
case "$opt" in
a) ARCH=$OPTARG ;;
b) BUILD=$OPTARG ;;
Expand All @@ -29,6 +30,7 @@ case "$opt" in
VER=$(git tag -l|grep -E '^v[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?$'|sort -r -V|head -1||:)
popd &> /dev/null
;;
i) INSTALL=1 ;;
x) VERBOSE=true ;;
esac
done
Expand Down Expand Up @@ -156,20 +158,29 @@ echo "BUILDING: $BIN"
# build
echo "BUILD:"

VERB=build
OUTPUT="-o $BIN"
if [ "$INSTALL" = "1" ]; then
VERB=install OUTPUT=""
fi
(set -x;
CC=$CC \
CXX=$CXX \
CGO_ENABLED=1 \
GOARCH=$ARCH \
go build \
go $VERB \
-v=$VERBOSE \
-x=$VERBOSE \
-ldflags="$LDFLAGS" \
-tags="$TAGS" \
-trimpath \
-o $BIN
$OUTPUT
) 2>&1 | log ' '

if [ "$INSTALL" = "1" ]; then
exit
fi

built_ver() {
if [[ "$PLATFORM" == "linux" && "$ARCH" != "$GOARCH" ]]; then
EXTRA=
Expand Down

0 comments on commit ea8b3ab

Please sign in to comment.