Home

tmpls @main - refs - log -
-
https://git.jolheiser.com/tmpls.git
tmpl templates
tree log patch
Add goreleaser template Signed-off-by: jolheiser <john.olheiser@gmail.com>
Signature
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEgqEQpE3xoo1QwJO/uFOtpdp7v3oFAmKbt4UACgkQuFOtpdp7 v3rKgg//YHzOSMnfYWoiR26I/CTmr4DbEbTUQm4+DeeOK2Xq2GwWOo6XUTvTtrVX gl2v8238dxUVTsmcAk4ecndubDZOGMGsmWPoHFng20tNCsKuZFUj7htJJuX/Ffj0 tsKxRmle/ywhwnGnrUp4LAb2JefthYCmkujPA/XP/geR6DD38bGEpu70JYfDMra3 FNhyuPbdxMnqhDr2zy9/HJal5NG8M0IFTh907Hj7saojYyvdzZZX7H6QRimLJUBH empN2vo+nm8TEWN0kfelhsBA5T0krXBkXOWUvZvROQg9ISBWlfz2XPA87IWlLVfp hX6MzeJJmYyH9Yyt0Tf3utOyVxo+qm9UMqXi6RCnzwMmvUYoVu5hzffJMSb3+lmY 0qZFSnhvguFR2VJ1etjchUAd/MDcpswXoxf4rU5QAj6v5tO1xuj1FtdyfMl5UL1b TkQWSpl0IEra17BVzWU1NeaHx3/EvWs7S66+kSA6pJyY0xegk2bLdMTydKOO7xu3 3weCopzfZtPkhToDxcw5cElL9DFMx7AROydvs+6onuCx0w2zAHgRkmpWA4QRp6+H DiPKly9KfD8u1CjlY3rM11wZvNfnbb/miPVxW5QAlPiOpwcd6VaKyenLe3lsXa1I xKhszgBzteJkvTPahZTtz4WnQKNhJXwtiABJPy+++us+OQldrH4= =WWne -----END PGP SIGNATURE-----
jolheiser <john.olheiser@gmail.com>
2 years ago
4 changed files, 70 additions(+), 7 deletions(-)
M template.toml -> template.toml
diff --git a/template.toml b/template.toml
index 1507fc7010e87ef33082677a8b06b15cfcf479cd..1e29c06091ea26be81bb87b41d56a629dc478d1f 100644
--- a/template.toml
+++ b/template.toml
@@ -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"
\ No newline at end of file
I template/.goreleaser.yaml
diff --git a/template/.goreleaser.yaml b/template/.goreleaser.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..83121c610c50d1c03240897d154b8d4cf54a16f7
--- /dev/null
+++ b/template/.goreleaser.yaml
@@ -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}}
D template/.tmplkeep
diff --git a/template/.tmplkeep b/template/.tmplkeep
deleted file mode 100644
index b4bd1aa2c0361fceac3ec18f307d949a46122254..0000000000000000000000000000000000000000
--- a/template/.tmplkeep
+++ /dev/null
@@ -1 +0,0 @@
-Delete this file and put something else here!
\ No newline at end of file
I template/.woodpecker/goreleaser.yml
diff --git a/template/.woodpecker/goreleaser.yml b/template/.woodpecker/goreleaser.yml
new file mode 100644
index 0000000000000000000000000000000000000000..589d07c397bdd8323845e01e4dfefd2d7ba89ff6
--- /dev/null
+++ b/template/.woodpecker/goreleaser.yml
@@ -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