48 lines
1.1 KiB
YAML
48 lines
1.1 KiB
YAML
version: '3'
|
|
|
|
vars:
|
|
VERSIONFILE: version.txt
|
|
RELEASE:
|
|
sh: svu next --strip-prefix
|
|
BRANCH:
|
|
sh: git branch --show-current
|
|
COMMIT:
|
|
sh: git rev-parse --short --verify {{.BRANCH}}
|
|
COMMITMSG: "chore: bump version to v{{.RELEASE}}"
|
|
|
|
tasks:
|
|
release:tag:
|
|
desc: Create a new tag
|
|
cmds:
|
|
- git tag v{{.RELEASE}}
|
|
- git push --tags
|
|
|
|
release:file:
|
|
desc: Update version.txt
|
|
generates:
|
|
- version.txt
|
|
cmds:
|
|
- echo {{.RELEASE}} >{{.VERSIONFILE}}
|
|
- git add {{.VERSIONFILE}}
|
|
- git commit -m "{{.COMMITMSG}}"
|
|
- git push
|
|
|
|
release:goreleaser:
|
|
desc: Create a new release with goreleaser
|
|
cmds:
|
|
- goreleaser release --clean
|
|
|
|
dorelease:
|
|
desc: Do all release steps
|
|
prompt: Create new release v{{.RELEASE}} from {{.COMMIT}}@{{.BRANCH}}?
|
|
preconditions:
|
|
- sh: test "{{.BRANCH}}" == "main"
|
|
cmds:
|
|
- task: release:file
|
|
- task: release:tag
|
|
- task: release:goreleaser
|
|
|
|
snapshot:
|
|
desc: Create a local snapshot release
|
|
cmds:
|
|
- goreleaser release --clean --snapshot
|