Add goreleaser
Signed-off-by: jolheiser <john.olheiser@gmail.com>pull/21/head
parent
fe9dd61580
commit
dacfe26650
|
@ -4,3 +4,4 @@
|
|||
# Binaries
|
||||
/tmpl
|
||||
/tmpl.exe
|
||||
dist/
|
|
@ -0,0 +1,25 @@
|
|||
builds:
|
||||
- env:
|
||||
- CGO_ENABLED=0
|
||||
goos:
|
||||
- linux
|
||||
- windows
|
||||
- darwin
|
||||
ldflags:
|
||||
- "-s -w -X go.jolheiser.com/tmpl/cmd.Version={{.Version}}"
|
||||
archives:
|
||||
- replacements:
|
||||
386: i386
|
||||
amd64: x86_64
|
||||
format_overrides:
|
||||
- goos: windows
|
||||
format: zip
|
||||
checksum:
|
||||
name_template: 'checksums.txt'
|
||||
release:
|
||||
gitea:
|
||||
owner: jolheiser
|
||||
name: tmpl
|
||||
gitea_urls:
|
||||
api: https://git.jojodev.com/api/v1/
|
||||
download: https://git.jojodev.com
|
|
@ -1,10 +1,6 @@
|
|||
clone:
|
||||
git:
|
||||
image: woodpeckerci/plugin-git:next
|
||||
|
||||
pipeline:
|
||||
compliance:
|
||||
image: golang:1.17
|
||||
image: golang:1.18
|
||||
commands:
|
||||
- go test -race ./...
|
||||
- go vet ./...
|
||||
|
@ -13,47 +9,20 @@ pipeline:
|
|||
when:
|
||||
event: pull_request
|
||||
|
||||
build:
|
||||
image: golang:1.17
|
||||
release:
|
||||
image: goreleaser/goreleaser
|
||||
commands:
|
||||
- GOOS="windows" go build
|
||||
- GOOS="linux" go build
|
||||
- goreleaser release
|
||||
secrets: [ gitea_token ]
|
||||
when:
|
||||
event: [ push, tag ]
|
||||
branch: main
|
||||
|
||||
release-main:
|
||||
image: jolheiser/drone-gitea-main:latest
|
||||
secrets:
|
||||
- source: gitea_token
|
||||
target: plugin_token
|
||||
base: https://git.jojodev.com
|
||||
files:
|
||||
- "tmpl"
|
||||
- "tmpl.exe"
|
||||
when:
|
||||
event: push
|
||||
branch: main
|
||||
|
||||
release-tag:
|
||||
image: plugins/gitea-release:1
|
||||
secrets:
|
||||
- source: gitea_token
|
||||
target: plugin_api_key
|
||||
base_url: https://git.jojodev.com
|
||||
files:
|
||||
- "tmpl"
|
||||
- "tmpl.exe"
|
||||
when:
|
||||
event: tag
|
||||
tag: v*
|
||||
|
||||
prune:
|
||||
image: jolheiser/drone-gitea-prune
|
||||
secrets:
|
||||
- source: gitea_token
|
||||
target: plugin_token
|
||||
settings:
|
||||
base: https://git.jojodev.com
|
||||
token:
|
||||
from_secret: gitea_token
|
||||
when:
|
||||
event: tag
|
||||
tag: v*
|
||||
|
|
Loading…
Reference in New Issue