updated ci files
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
Paul 2020-04-12 16:35:17 +02:00
parent b52f93d7d6
commit 90bf13586d
2 changed files with 8 additions and 16 deletions

View File

@ -17,8 +17,7 @@ steps:
base_url: https://git.paulbsd.com base_url: https://git.paulbsd.com
api_key: api_key:
from_secret: gitea_token from_secret: gitea_token
files: dist/*.tar.gz files: "*.tar.gz"
title: $DRONE_TAG
checksum: checksum:
- sha256 - sha256
- sha512 - sha512
@ -44,8 +43,7 @@ steps:
base_url: https://git.paulbsd.com base_url: https://git.paulbsd.com
api_key: api_key:
from_secret: gitea_token from_secret: gitea_token
files: dist/*.tar.gz files: "*.tar.gz"
title: $DRONE_TAG
checksum: checksum:
- sha256 - sha256
- sha512 - sha512
@ -71,8 +69,7 @@ steps:
base_url: https://git.paulbsd.com base_url: https://git.paulbsd.com
api_key: api_key:
from_secret: gitea_token from_secret: gitea_token
files: dist/*.tar.gz files: "*.tar.gz"
title: $DRONE_TAG
checksum: checksum:
- sha256 - sha256
- sha512 - sha512

View File

@ -1,10 +1,10 @@
#!/bin/bash #!/bin/bash
RELEASEDIR=dist PROJECTNAME=qrz
RELEASENAME=qrz RELEASENAME=${PROJECTNAME}
VERSION="0" VERSION="0"
GOOPTIONS="-mod=vendor -ldflags='-s -w'" GOOPTIONS="-mod=vendor"
SRCFILES=cmd/qrz/*.go SRCFILES=cmd/qrz/*.go
build() { build() {
@ -16,18 +16,13 @@ build() {
VERSION=$DRONE_COMMIT VERSION=$DRONE_COMMIT
fi fi
if [[ ! -d $RELEASEDIR ]]
then
mkdir dist
fi
if [[ ! -z $VERSION && ! -z $GOOS && ! -z $GOARCH ]] if [[ ! -z $VERSION && ! -z $GOOS && ! -z $GOARCH ]]
then then
RELEASENAME=qrz-${VERSION}-${GOOS}-${GOARCH} RELEASENAME=${PROJECTNAME}-${VERSION}-${GOOS}-${GOARCH}
fi fi
go build -o ${RELEASEDIR}/${RELEASENAME} ${GOOPTIONS} ${SRCFILES} go build -o ${RELEASENAME} ${GOOPTIONS} ${SRCFILES}
if [[ ! -z $DRONE_TAG ]] if [[ ! -z $DRONE_TAG ]]
then then
cd ${RELEASEDIR}
tar -czvf ${RELEASENAME}.tar.gz ${RELEASENAME} tar -czvf ${RELEASENAME}.tar.gz ${RELEASENAME}
fi fi
} }