Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ go.work.sum

esctl

*.sh

*.json
*.log

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ goupdate:
go get -t -u=patch ./...

release:
./mkrel.sh $(tool) $(BRANCH) $(COMMIT) $(GOVERSION) $(APIVERSION) $(VERSION)
./mkrel.sh $(tool) $(COMMIT) $(GOVERSION) $(APIVERSION) $(VERSION) $(BRANCH)

show-versions: buildlocal
@echo "### esctl version:"
Expand Down
59 changes: 59 additions & 0 deletions mkrel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/bin/bash

set -e

#
# Copyright © 2023-2024 Thomas von Dein <tom@f-i-ts.de>
# Copyright 2024 Finanz Informatik Technologie Service GmbH & Co KG
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

# get list with: go tool dist list
DIST="linux/amd64
windows/amd64
darwin/amd64"

tool="$1"
COMMIT="$2"
GOVERSION="$3"
APIVERSION="$4"
version="$5"
BRANCH="$6"

if test -z "$BRANCH"; then
BRANCH=main
fi

rm -rf releases
mkdir -p releases

for D in $DIST; do
os=${D/\/*/}
arch=${D/*\//}
binfile="releases/${tool}-${os}-${arch}-${version}"

case "$os" in
windows)
binfile="${binfile}.exe"
;;
esac

set -x
GOOS=${os} GOARCH=${arch} go build -tags osusergo,netgo \
-ldflags "-extldflags=-static -X github.com/fi-ts/esctl/pkg/cfg.BRANCH=${BRANCH} -X github.com/fi-ts/esctl/pkg/cfg.COMMIT=${COMMIT} -X github.com/fi-ts/esctl/pkg/cfg.GOVERSION=${GOVERSION} -X github.com/fi-ts/esctl/pkg/cfg.APIVERSION=${APIVERSION} -X github.com/fi-ts/esctl/pkg/cfg.BUILD=${BUILD}" -o "${binfile}"

sha256sum ${binfile} | cut -d' ' -f1 > ${binfile}.sha256
set +x
done

Loading