Compare commits

...

4 Commits

Author SHA1 Message Date
jolheiser ae7b7df1e3
Fix template
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2022-06-14 14:18:11 -05:00
jolheiser d8b5196d4f
Update to new format
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2022-06-14 14:01:52 -05:00
jolheiser 1e67b05f62
Update template
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2022-06-13 22:55:52 -05:00
jolheiser c6344456e8
Add goreleaser template
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2022-06-04 14:50:29 -05:00
7 changed files with 83 additions and 10 deletions

View File

@ -1,4 +1,4 @@
Copyright (c) 2020 John Olheiser
Copyright (c) 2022 John Olheiser
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,6 @@
# tmpl templates
# goreleaser
Check out the various branches for some basic examples of templates.
A template to generate `goreleaser` config and accompanying Woodpecker pipeline.
## License

View File

@ -1,6 +0,0 @@
# template.toml
# Write any template args here to prompt the user for, giving any defaults/options as applicable
name = "MyProject"
lang = ["Go", "Rust", "Python"]

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: {{gitea_user}}
name: {{gitea_repo}}
gitea_urls:
api: https://{{gitea_domain}}/api/v1/
download: https://{{gitea_domain}}

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: https://{{gitea_domain}}
token:
from_secret: gitea_token
when:
event: tag

16
tmpl.yaml 100644
View File

@ -0,0 +1,16 @@
prompts:
- id: gitea_domain
label: Gitea Domain
default: git.jojodev.com
help: No protocol or trailing slash
- id: gitea_user
label: Gitea User
- id: gitea_repo
label: Gitea Repo
- id: module
label: Module
default: ${TMPL_PROMPT_GITEA_DOMAIN}/${TMPL_PROMPT_GITEA_USER}/${TMPL_PROMPT_GITEA_REPO}
- id: version_package
label: Version Package
help: The package where the `Version` variable is
default: ${TMPL_PROMPT_MODULE}/cmd