Add goreleaser
ci/woodpecker/push/woodpecker Pipeline was successful Details
ci/woodpecker/pr/woodpecker Pipeline was successful Details

Signed-off-by: jolheiser <john.olheiser@gmail.com>
pull/21/head
jolheiser 2022-06-02 22:23:14 -05:00
parent fe9dd61580
commit dacfe26650
Signed by: jolheiser
GPG Key ID: B853ADA5DA7BBF7A
3 changed files with 36 additions and 41 deletions

3
.gitignore vendored
View File

@ -3,4 +3,5 @@
# Binaries
/tmpl
/tmpl.exe
/tmpl.exe
dist/

25
.goreleaser.yaml 100644
View File

@ -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

View File

@ -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
base: https://git.jojodev.com
settings:
base: https://git.jojodev.com
token:
from_secret: gitea_token
when:
event: tag
tag: v*