From dfd80c482cc45afd3b969291de2dd16903b1ca73 Mon Sep 17 00:00:00 2001 From: Kujtim Hoxha Date: Wed, 19 Nov 2025 16:47:06 +0100 Subject: [PATCH] chore: add release task --- Taskfile.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Taskfile.yaml b/Taskfile.yaml index 580d43294c2a835bbda0b2bf0cff7aef7f76d3cc..d056ed669fa5dccf97e712aeb9cb7341c76345e8 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -37,3 +37,19 @@ tasks: aliases: [default] cmds: - go run . + release: + desc: Create and push a new tag following semver + vars: + NEXT: + sh: svu next --always || go run github.com/caarlos0/svu/v3@latest next --always + prompt: "This will release {{.NEXT}}. Continue?" + preconditions: + - sh: '[ $(git symbolic-ref --short HEAD) = "main" ]' + msg: Not on main branch + - sh: "[ $(git status --porcelain=2 | wc -l) = 0 ]" + msg: "Git is dirty" + cmds: + - git commit --allow-empty -m "{{.NEXT}}" + - git tag --annotate --sign -m "{{.NEXT}}" {{.NEXT}} {{.CLI_ARGS}} + - echo "Pushing {{.NEXT}}..." + - git push origin main --follow-tags