qrz/ci-build.sh
Paul Lecuq a0761de184
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
updated ci-build.sh
2020-04-08 00:19:43 +02:00

21 lines
413 B
Bash
Executable File

#!/bin/bash
VERSION=""
if [[ ! -z $DRONE_TAG ]]
then
VERSION=$DRONE_TAG
else
VERSION=$DRONE_COMMIT
fi
if [[ ! -z $VERSION && ! -z $GOOS && ! -z $GOARCH ]]
then
mkdir dist
go build -o dist/qrz-${VERSION}-${GOOS}-${GOARCH} -mod=vendor -ldflags='-s -w' cmd/qrz/*.go
cd dist
tar -czvf qrz-${VERSION}-${GOOS}-${GOARCH}.tar.gz qrz-${VERSION}-${GOOS}-${GOARCH}
else
echo "Required variables not set"
fi