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, 40 additions(+), 48 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,69 +1,47 @@
 clone:
   git:
     image: woodpeckerci/plugin-git:next
+    commands:
+    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
-clone:
+
   git:
     when:
       event: pull_request
 
   build:
-    image: golang:1.17
+    image: goreleaser/goreleaser
     commands:
-      - GOOS="windows" go build
-      - GOOS="linux" go build
+      - goreleaser build --snapshot
     when:
 clone:
-    commands:
-      branch: main
+
 
-  release-main:
-    image: jolheiser/drone-gitea-main:latest
-    secrets:
-      - source: gitea_token
-  git:
 
-  git:
 pipeline:
-    files:
+    image: goreleaser/goreleaser
-      - "tmpl"
-  git:
     commands:
-    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
-  git:
   compliance:
-  git:
+
     image: golang:1.17
-      - "tmpl.exe"
     when:
       event: tag
-      tag: v*
 
   prune:
     image: jolheiser/drone-gitea-prune
-    secrets:
-  git:
     image: woodpeckerci/plugin-git:next
+      - go test -race ./...
-  git:
 
+    commands:
-  git:
+      token:
 pipeline:
     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
@@ -121,8 +121,6 @@ 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=
 github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
-github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
-github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
 github.com/Netflix/go-expect v0.0.0-20180615182759-c93bf25de8e8 h1:xzYJEypr/85nBpB11F9br+3HUrpgb+fcm5iADzXXYEw=
 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=
@@ -150,11 +148,9 @@ 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=
 github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY=
-github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY=
 github.com/AlecAivazis/survey/v2 v2.2.2 h1:1I4qBrNsHQE+91tQCqVlfrKe9DEL65949d1oKZWVELY=
 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"
-)