32 lines
831 B
YAML
32 lines
831 B
YAML
|
pipeline:
|
||
|
build_test:
|
||
|
image: golang:1.16
|
||
|
commands:
|
||
|
- go build
|
||
|
|
||
|
test:
|
||
|
image: golang:1.16
|
||
|
commands:
|
||
|
- go test -v ./...
|
||
|
|
||
|
build_release:
|
||
|
image: golang:1.16
|
||
|
commands:
|
||
|
- go mod vendor
|
||
|
- GOOS=linux GOARCH=amd64 go build -ldflags "-X git.metaunix.net/BitGoblin/mcst/cmd.version=${CI_COMMIT_TAG}" -o "dist/mcst-linux-amd64-${CI_COMMIT_TAG}"
|
||
|
- GOOS=windows GOARCH=amd64 go build -ldflags "-X git.metaunix.net/BitGoblin/mcst/cmd.version=${CI_COMMIT_TAG}" -o "dist/mcst-windows-amd64-${CI_COMMIT_TAG}.exe"
|
||
|
when:
|
||
|
event: tag
|
||
|
|
||
|
gitea_release:
|
||
|
image: plugins/gitea-release
|
||
|
settings:
|
||
|
api_key:
|
||
|
from_secret: gitea_api_key
|
||
|
base_url: https://git.metaunix.net
|
||
|
title: "${CI_COMMIT_TAG}"
|
||
|
files:
|
||
|
- dist/mcst-*
|
||
|
when:
|
||
|
event: tag
|