Add goreleaser
Signed-off-by: jolheiser <john.olheiser@gmail.com>pull/21/head
parent
fe9dd61580
commit
dacfe26650
|
@ -3,4 +3,5 @@
|
||||||
|
|
||||||
# Binaries
|
# Binaries
|
||||||
/tmpl
|
/tmpl
|
||||||
/tmpl.exe
|
/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:
|
pipeline:
|
||||||
compliance:
|
compliance:
|
||||||
image: golang:1.17
|
image: golang:1.18
|
||||||
commands:
|
commands:
|
||||||
- go test -race ./...
|
- go test -race ./...
|
||||||
- go vet ./...
|
- go vet ./...
|
||||||
|
@ -13,47 +9,20 @@ pipeline:
|
||||||
when:
|
when:
|
||||||
event: pull_request
|
event: pull_request
|
||||||
|
|
||||||
build:
|
release:
|
||||||
image: golang:1.17
|
image: goreleaser/goreleaser
|
||||||
commands:
|
commands:
|
||||||
- GOOS="windows" go build
|
- goreleaser release
|
||||||
- GOOS="linux" go build
|
secrets: [ gitea_token ]
|
||||||
when:
|
when:
|
||||||
event: [ push, tag ]
|
event: [ push, tag ]
|
||||||
branch: main
|
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:
|
prune:
|
||||||
image: jolheiser/drone-gitea-prune
|
image: jolheiser/drone-gitea-prune
|
||||||
secrets:
|
settings:
|
||||||
- source: gitea_token
|
base: https://git.jojodev.com
|
||||||
target: plugin_token
|
token:
|
||||||
base: https://git.jojodev.com
|
from_secret: gitea_token
|
||||||
when:
|
when:
|
||||||
event: tag
|
event: tag
|
||||||
tag: v*
|
|
||||||
|
|
Loading…
Reference in New Issue