Home

tmpl @main - refs - log -
-
https://git.jolheiser.com/tmpl.git
Template automation
tree log patch
Add goreleaser (#21) Reviewed-on: https://git.jojodev.com/jolheiser/tmpl/pulls/21
jolheiser <john.olheiser@gmail.com>
2 years ago
5 changed files, 44 additions(+), 49 deletions(-)
M .gitignore -> .gitignore
diff --git a/.gitignore b/.gitignore
index afb63d4c0c5eb3f1223b89f5db32fd6fbd484bb0..c0c7cc952a2f4787bc1adc85cb3aca09fcb0a485 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,4 +3,5 @@ .idea/
 
 # Binaries
 /tmpl
-/tmpl.exe
\ No newline at end of file
+/tmpl.exe
+dist/
\ No newline at end of file
I .goreleaser.yaml
diff --git a/.goreleaser.yaml b/.goreleaser.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..a672de5293b662eed6ef8f3d0a71fbc14de8b2d3
--- /dev/null
+++ b/.goreleaser.yaml
@@ -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
M .woodpecker.yml -> .woodpecker.yml
diff --git a/.woodpecker.yml b/.woodpecker.yml
index 2d9dbb075fd7a975b5ff23d28c80bd1fe016a797..d46ebfcebd854b9608c0b403885da7c402117f43 100644
--- a/.woodpecker.yml
+++ b/.woodpecker.yml
@@ -1,59 +1,39 @@
 clone:
   git:
-    image: woodpeckerci/plugin-git:next
+    image: woodpeckerci/plugin-git
+    settings:
+      tags: true
 
 pipeline:
   compliance:
-    image: golang:1.17
+    image: golang:1.18
     commands:
       - go test -race ./...
       - go vet ./...
-      - go run github.com/rs/zerolog/cmd/lint go.jolheiser.com/tmpl
-      - go build
+      - go run github.com/rs/zerolog/cmd/lint@latest go.jolheiser.com/tmpl
     when:
       event: pull_request
 
   build:
-    image: golang:1.17
+    image: goreleaser/goreleaser
     commands:
-      - GOOS="windows" go build
-      - GOOS="linux" go build
-    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"
+      - goreleaser build --snapshot
     when:
-      event: push
-      branch: main
+      event: pull_request
 
-  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"
+  release:
+    image: goreleaser/goreleaser
+    commands:
+      - goreleaser release
+    secrets: [ gitea_token ]
     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*
M go.sum -> go.sum
diff --git a/go.sum b/go.sum
index e9c797a88faeceb0832d5354d0dba32991a09037..2901739a5e00ee535150e20ed6c4e4a11a11d624 100644
--- a/go.sum
+++ b/go.sum
@@ -120,7 +120,6 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9 h1:umElSU9WZirRdgu2yFHY0ayQkEnKiOC1TtM3fWXFnoU=
 golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
-golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo=
 golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
 golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
 golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
@@ -147,11 +146,9 @@ golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
 golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
 golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.1.7 h1:6j8CgantCy3yc8JGBqkDLMKWqZ0RDU2g1HVgacojGWQ=
 golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo=
 golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
D tools.go
diff --git a/tools.go b/tools.go
deleted file mode 100644
index 048b2fa9451573cc3be774d6ba393bc16a7b1793..0000000000000000000000000000000000000000
--- a/tools.go
+++ /dev/null
@@ -1,8 +0,0 @@
-//go:build tools
-// +build tools
-
-package main
-
-import (
-	_ "github.com/rs/zerolog/cmd/lint"
-)