diff --git a/.drone.yml b/.drone.yml index b86cd81..e53814a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -10,14 +10,11 @@ platform: steps: - name: build image: golang + commands: + - ./ci-build.sh environment: GOOS: linux GOARCH: amd64 - commands: - - 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" - name: release image: plugins/gitea-release settings: diff --git a/ci-build.sh b/ci-build.sh new file mode 100755 index 0000000..727516e --- /dev/null +++ b/ci-build.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +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 +else + echo "Required variables not set" +fi