2024-11-09 09:42:26 +00:00
|
|
|
# yaml-language-server: $schema=https://taskfile.dev/schema.json
|
2024-11-08 14:13:46 +00:00
|
|
|
version: '3'
|
|
|
|
|
|
|
|
vars:
|
2024-11-08 16:44:10 +00:00
|
|
|
VERSIONFILE: version.txt
|
2024-11-08 14:13:46 +00:00
|
|
|
RELEASE:
|
|
|
|
sh: svu next --strip-prefix
|
2024-11-08 16:44:10 +00:00
|
|
|
BRANCH:
|
2024-11-08 15:00:57 +00:00
|
|
|
sh: git branch --show-current
|
2024-11-08 16:44:10 +00:00
|
|
|
COMMIT:
|
|
|
|
sh: git rev-parse --short --verify {{.BRANCH}}
|
|
|
|
COMMITMSG: "chore: bump version to v{{.RELEASE}}"
|
2024-11-08 14:13:46 +00:00
|
|
|
|
|
|
|
tasks:
|
|
|
|
release:tag:
|
2024-11-09 08:53:10 +00:00
|
|
|
desc: Create a new tag
|
2024-11-08 14:13:46 +00:00
|
|
|
cmds:
|
|
|
|
- git tag v{{.RELEASE}}
|
2024-11-09 08:53:10 +00:00
|
|
|
- git push --tags
|
2024-11-08 14:13:46 +00:00
|
|
|
|
|
|
|
release:file:
|
2024-11-09 08:53:10 +00:00
|
|
|
desc: Update version.txt
|
|
|
|
generates:
|
|
|
|
- version.txt
|
2024-11-08 14:13:46 +00:00
|
|
|
cmds:
|
|
|
|
- echo {{.RELEASE}} >{{.VERSIONFILE}}
|
|
|
|
- git add {{.VERSIONFILE}}
|
|
|
|
- git commit -m "{{.COMMITMSG}}"
|
2024-11-09 08:53:10 +00:00
|
|
|
- git push
|
|
|
|
|
|
|
|
release:goreleaser:
|
|
|
|
desc: Create a new release with goreleaser
|
|
|
|
cmds:
|
|
|
|
- goreleaser release --clean
|
2024-11-08 14:13:46 +00:00
|
|
|
|
2024-11-09 08:53:10 +00:00
|
|
|
dorelease:
|
|
|
|
desc: Do all release steps
|
2024-11-08 16:44:10 +00:00
|
|
|
prompt: Create new release v{{.RELEASE}} from {{.COMMIT}}@{{.BRANCH}}?
|
2024-11-09 08:59:51 +00:00
|
|
|
preconditions:
|
|
|
|
- sh: test "{{.BRANCH}}" == "main"
|
2024-11-08 14:13:46 +00:00
|
|
|
cmds:
|
|
|
|
- task: release:file
|
|
|
|
- task: release:tag
|
2024-11-09 08:53:10 +00:00
|
|
|
- task: release:goreleaser
|
2024-11-09 09:13:52 +00:00
|
|
|
|
|
|
|
snapshot:
|
|
|
|
desc: Create a local snapshot release
|
|
|
|
cmds:
|
|
|
|
- goreleaser release --clean --snapshot
|