Compare commits

...

5 commits

2 changed files with 13 additions and 28 deletions

View file

@ -1,10 +1,10 @@
# vim: set ts=2 sw=2 tw=0 fo=cnqoj # vim: set ts=2 sw=2 tw=0 fo=cnqoj
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
version: 2 version: 2
before: before:
hooks: hooks:
- rm -fr ./dist
- go mod tidy - go mod tidy
builds: builds:

View file

@ -1,46 +1,31 @@
# yaml-language-server: $schema=https://taskfile.dev/schema.json
#
# Requirements:
# github.com/caarlos0/svu@latest
# github.com/goreleaser/goreleaser/v2@latest
version: '3' version: '3'
vars: vars:
VERSIONFILE: version.txt
RELEASE: RELEASE:
sh: svu next sh: svu next
BRANCH: BRANCH:
sh: git branch --show-current sh: git branch --show-current
COMMIT: COMMIT:
sh: git rev-parse --short --verify {{.BRANCH}} sh: git rev-parse --short --verify {{.BRANCH}}
COMMITMSG: "chore: bump version to {{.RELEASE}}"
tasks: tasks:
release:tag:
desc: Create a new tag
cmds:
- git tag {{.RELEASE}}
- git push --tags
release:file: release:
desc: Update version.txt desc: Create and publish an new release
generates:
- version.txt
cmds:
- echo {{.RELEASE}} >{{.VERSIONFILE}}
- git add {{.VERSIONFILE}}
- git commit -m "{{.COMMITMSG}}"
- git push
release:goreleaser:
desc: Create a new release with goreleaser
cmds:
- goreleaser release --clean
dorelease:
desc: Do all release steps
prompt: Create new release {{.RELEASE}} from {{.COMMIT}}@{{.BRANCH}}? prompt: Create new release {{.RELEASE}} from {{.COMMIT}}@{{.BRANCH}}?
preconditions: preconditions:
- sh: test "{{.BRANCH}}" == "main" - sh: test "{{.BRANCH}}" == "main"
cmds: cmds:
- task: release:file - git tag {{.RELEASE}}
- task: release:tag - git push
- task: release:goreleaser - git push origin tag {{.RELEASE}}
- goreleaser release --clean
snapshot: snapshot:
desc: Create a local snapshot release desc: Create a local snapshot release