added script to build for drone
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
7955eea825
commit
88adfa691e
@ -10,14 +10,11 @@ platform:
|
|||||||
steps:
|
steps:
|
||||||
- name: build
|
- name: build
|
||||||
image: golang
|
image: golang
|
||||||
|
commands:
|
||||||
|
- ./ci-build.sh
|
||||||
environment:
|
environment:
|
||||||
GOOS: linux
|
GOOS: linux
|
||||||
GOARCH: amd64
|
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
|
- name: release
|
||||||
image: plugins/gitea-release
|
image: plugins/gitea-release
|
||||||
settings:
|
settings:
|
||||||
|
11
ci-build.sh
Executable file
11
ci-build.sh
Executable file
@ -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
|
Loading…
Reference in New Issue
Block a user