Add goreleaser template

Signed-off-by: jolheiser <john.olheiser@gmail.com>
goreleaser
jolheiser 2022-06-04 14:50:29 -05:00
parent ac63841684
commit c6344456e8
Signed by: jolheiser
GPG Key ID: B853ADA5DA7BBF7A
4 changed files with 70 additions and 7 deletions

View File

@ -1,6 +1,6 @@
# template.toml gitea_url = "https://git.jojodev.com"
# Write any template args here to prompt the user for, giving any defaults/options as applicable gitea_user = ""
gitea_repo = ""
name = "MyProject" name = "${TMPL_PROMPT_GITEA_REPO}"
module = "${TMPL_PROMPT_GITEA_URL}/${TMPL_PROMPT_GITEA_USER}/${TMPL_PROMPT_GITEA_REPO}"
lang = ["Go", "Rust", "Python"] version_package = "${TMPL_PROMPT_MODULE}/cmd"

View File

@ -0,0 +1,25 @@
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
ldflags:
- "-s -w -X {{version_package}}.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: {{gitea_repo}}
gitea_urls:
api: {{gitea_url}}/api/v1/
download: {{gitea_url}}

View File

@ -1 +0,0 @@
Delete this file and put something else here!

View File

@ -0,0 +1,39 @@
clone:
git:
image: woodpeckerci/plugin-git
settings:
tags: true
pipeline:
compliance:
image: golang:1.18
commands:
- go test -race ./...
- go vet ./...
- go run github.com/rs/zerolog/cmd/lint@latest {{module}}
when:
event: pull_request
build:
image: goreleaser/goreleaser
commands:
- goreleaser build --snapshot
when:
event: pull_request
release:
image: goreleaser/goreleaser
commands:
- goreleaser release
secrets: [ gitea_token ]
when:
event: tag
prune:
image: jolheiser/drone-gitea-prune
settings:
base: {{gitea_url}}
token:
from_secret: gitea_token
when:
event: tag