-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtaskfile.yaml
More file actions
76 lines (66 loc) · 2.08 KB
/
taskfile.yaml
File metadata and controls
76 lines (66 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
version: "3"
tasks:
update:
desc: Updates all dependencies
aliases: [up]
silent: true
cmds:
- go mod tidy
build:
desc: Build a local snapshot with goreleaser
silent: true
cmds:
- "goreleaser release --snapshot --clean --skip=publish"
lint:
desc: Run golangci-lint on the codebase
silent: true
cmd: "golangci-lint run {{.CLI_ARGS}}"
lint:fix:
desc: Run golangci-lint --fix on the codebase
silent: true
cmd: "golangci-lint run --fix"
test:
desc: Run the test suite (unit tests only)
silent: true
cmd: go test ./... -cover -short
test:ci:
desc: Run the test suite for CI with coverage profile
silent: true
cmd: go test -v -coverprofile=coverage.out ./...
tag:
desc: Create and push a new signed tag for release
prompt: This will create, sign, and push tag {{.TAG}}. Continue?
requires:
vars: [TAG]
preconditions:
- sh: git diff --quiet
msg: "Working directory must be clean"
- sh: git diff --cached --quiet
msg: "No staged changes allowed"
- sh: '[[ "{{.TAG}}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]'
msg: "TAG must be in format vX.Y.Z (e.g., v1.0.0)"
cmds:
- git tag -s {{.TAG}} -m "Release {{.TAG}}"
- git push origin {{.TAG}}
- echo "Signed tag {{.TAG}} created and pushed. GitHub Actions will now build and release."
tag:patch:
desc: Create and push a patch version tag (v0.0.X)
cmds:
- task: tag
vars:
TAG:
sh: git describe --tags --abbrev=0 2>/dev/null | awk -F. '{print $1"."$2"."$3+1}' || echo "v0.0.1"
tag:minor:
desc: Create and push a minor version tag (v0.X.0)
cmds:
- task: tag
vars:
TAG:
sh: git describe --tags --abbrev=0 2>/dev/null | awk -F. '{print $1"."$2+1".0"}' || echo "v0.1.0"
tag:major:
desc: Create and push a major version tag (vX.0.0)
cmds:
- task: tag
vars:
TAG:
sh: git describe --tags --abbrev=0 2>/dev/null | awk -F. '{print $1+1".0.0"}' | sed 's/^v/v/' || echo "v1.0.0"