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