diff --git a/Taskfile.yml b/Taskfile.yml index d6f413e..9d92541 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -1,23 +1,21 @@ version: '3' vars: + VERSIONFILE: version.txt RELEASE: sh: svu next --strip-prefix - VERSIONFILE: version.txt - COMMITMSG: "chore: bump version to v{{.RELEASE}}" - CURRENTBRANCH: + BRANCH: sh: git branch --show-current + COMMIT: + sh: git rev-parse --short --verify {{.BRANCH}} + COMMITMSG: "chore: bump version to v{{.RELEASE}}" tasks: release:tag: - preconditions: - - test {{.CURRENTBRANCH}} == "main" cmds: - git tag v{{.RELEASE}} release:file: - preconditions: - - test {{.CURRENTBRANCH}} == "main" cmds: - echo {{.RELEASE}} >{{.VERSIONFILE}} - git add {{.VERSIONFILE}} @@ -25,6 +23,7 @@ tasks: release:push: aliases: [dorelease] + prompt: Create new release v{{.RELEASE}} from {{.COMMIT}}@{{.BRANCH}}? cmds: - task: release:file - task: release:tag