From 670963e70b78934aef812ee1e9b9fbe476efa4b5 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Mon, 1 Jun 2026 12:28:34 -0400 Subject: [PATCH] chore(task): add release and fetch-tags tasks --- Taskfile.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Taskfile.yaml b/Taskfile.yaml index 39cc28a2..10e47f30 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -12,3 +12,27 @@ tasks: desc: Run tests cmds: - go test -race -count 4 -cpu 1,4 ./... {{.CLI_ARGS}} + + 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" + - sh: 'gh run list --workflow build.yml --commit $(git rev-parse HEAD) --status success --json conclusion -q ".[0].conclusion" | grep -q success' + msg: "Test build for this commit failed or not present" + cmds: + - task: fetch-tags + - git commit --allow-empty -m "{{.NEXT}}" + - git tag --annotate --sign -m "{{.NEXT}}" {{.NEXT}} {{.CLI_ARGS}} + - echo "Pushing {{.NEXT}}..." + - git push origin main --follow-tags + + fetch-tags: + cmds: + - git fetch --tags