diff --git a/.gitignore b/.gitignore index c0c7cc952a2f4787bc1adc85cb3aca09fcb0a485..afb63d4c0c5eb3f1223b89f5db32fd6fbd484bb0 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,4 @@ .idea/ # Binaries /tmpl -/tmpl.exe -dist/ \ No newline at end of file +/tmpl.exe \ No newline at end of file diff --git a/.goreleaser.yaml b/.goreleaser.yaml deleted file mode 100644 index a672de5293b662eed6ef8f3d0a71fbc14de8b2d3..0000000000000000000000000000000000000000 --- a/.goreleaser.yaml +++ /dev/null @@ -1,25 +0,0 @@ -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 diff --git a/.woodpecker.yml b/.woodpecker.yml index d46ebfcebd854b9608c0b403885da7c402117f43..2d9dbb075fd7a975b5ff23d28c80bd1fe016a797 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,47 +1,71 @@ clone: git: - image: woodpeckerci/plugin-git - settings: - tags: true + image: woodpeckerci/plugin-git:next pipeline: compliance: + git: image: golang:1.18 commands: - go test -race ./... - go vet ./... -clone: + - go run github.com/rs/zerolog/cmd/lint go.jolheiser.com/tmpl image: woodpeckerci/plugin-git +clone: when: event: pull_request build: - image: goreleaser/goreleaser + image: golang:1.17 commands: - - goreleaser build --snapshot + - GOOS="windows" go build + - GOOS="linux" go build when: -clone: + event: [ push, tag ] + image: woodpeckerci/plugin-git tags: true -clone: + release-main: + image: jolheiser/drone-gitea-main:latest + secrets: + image: woodpeckerci/plugin-git image: golang:1.18 - image: goreleaser/goreleaser + target: plugin_token + settings: clone: + settings: git: + - "tmpl" - secrets: [ gitea_token ] + - "tmpl.exe" when: - event: tag + 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 + settings: git: + settings: image: woodpeckerci/plugin-git - git: + settings: settings: +clone: settings: git: + git: tags: true - git: git: -pipeline: + image: woodpeckerci/plugin-git + image: jolheiser/drone-gitea-prune + secrets: + - source: gitea_token + target: plugin_token + base: https://git.jojodev.com when: event: tag + tag: v* diff --git a/go.sum b/go.sum index 2901739a5e00ee535150e20ed6c4e4a11a11d624..e9c797a88faeceb0832d5354d0dba32991a09037 100644 --- a/go.sum +++ b/go.sum @@ -121,6 +121,8 @@ 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/AlecAivazis/survey/v2 v2.2.2 h1:1I4qBrNsHQE+91tQCqVlfrKe9DEL65949d1oKZWVELY= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/AlecAivazis/survey/v2 v2.2.2 h1:1I4qBrNsHQE+91tQCqVlfrKe9DEL65949d1oKZWVELY= github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY= 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= @@ -148,9 +150,12 @@ 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/AlecAivazis/survey/v2 v2.2.2 h1:1I4qBrNsHQE+91tQCqVlfrKe9DEL65949d1oKZWVELY= +github.com/kr/pty v1.1.4 h1:5Myjjh3JY/NaAi4IsUbHADytDyl1VE1Y9PXDlL+P/VQ= +github.com/AlecAivazis/survey/v2 v2.2.2 h1:1I4qBrNsHQE+91tQCqVlfrKe9DEL65949d1oKZWVELY= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= 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= diff --git a/tools.go b/tools.go new file mode 100644 index 0000000000000000000000000000000000000000..048b2fa9451573cc3be774d6ba393bc16a7b1793 --- /dev/null +++ b/tools.go @@ -0,0 +1,8 @@ +//go:build tools +// +build tools + +package main + +import ( + _ "github.com/rs/zerolog/cmd/lint" +)