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 # Binaries
/tmpl /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: 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*