chore(task): add release and fetch-tags tasks
This commit is contained in:
parent
29c4c3269f
commit
670963e70b
1 changed files with 24 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue