-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathTaskfile.yml
More file actions
126 lines (111 loc) · 3.18 KB
/
Copy pathTaskfile.yml
File metadata and controls
126 lines (111 loc) · 3.18 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
version: '3'
vars:
BINARY: tempo
VERSION:
sh: git describe --tags --always --dirty 2>/dev/null || echo "dev"
COMMIT:
sh: git rev-parse --short HEAD 2>/dev/null || echo "unknown"
BUILD_DATE:
sh: date -u +"%Y-%m-%dT%H:%M:%SZ"
LDFLAGS: -s -w -X github.com/galaxy-io/tempo/internal/update.Version={{.VERSION}} -X github.com/galaxy-io/tempo/internal/update.Commit={{.COMMIT}} -X github.com/galaxy-io/tempo/internal/update.BuildDate={{.BUILD_DATE}}
tasks:
default:
desc: Show available tasks
cmds:
- task --list
build:
desc: Build the tempo binary
cmds:
- go build -ldflags "{{.LDFLAGS}}" -o {{.BINARY}} ./cmd/tempo
sources:
- ./**/*.go
- go.mod
- go.sum
generates:
- "{{.BINARY}}"
dev:
desc: Build and run in development mode
cmds:
- go build -ldflags "{{.LDFLAGS}}" -o {{.BINARY}} ./cmd/tempo
- ./{{.BINARY}} --dev
interactive: true
run:
desc: Build and run
cmds:
- go build -ldflags "{{.LDFLAGS}}" -o {{.BINARY}} ./cmd/tempo
- ./{{.BINARY}}
interactive: true
clean:
desc: Remove build artifacts
cmds:
- rm -f {{.BINARY}}
- rm -rf dist/
tidy:
desc: Tidy and verify go modules
cmds:
- go mod tidy
- go mod verify
lint:
desc: Run linter
cmds:
- golangci-lint run ./...
test:
desc: Run tests
cmds:
- go test -v ./...
tag:
desc: Create a new version tag
summary: |
Creates a git tag for release.
Usage: task tag -- v1.0.0
cmds:
- |
if [ -z "{{.CLI_ARGS}}" ]; then
echo "Usage: task tag -- v1.0.0"
echo ""
echo "Current tags:"
git tag --sort=-v:refname | head -10
exit 1
fi
git tag -a {{.CLI_ARGS}} -m "Release {{.CLI_ARGS}}"
echo "Created tag {{.CLI_ARGS}}"
echo "Push with: git push origin {{.CLI_ARGS}}"
tag-push:
desc: Create and push a new version tag
summary: |
Creates and pushes a git tag to trigger release.
Usage: task tag-push -- v1.0.0
cmds:
- |
if [ -z "{{.CLI_ARGS}}" ]; then
echo "Usage: task tag-push -- v1.0.0"
exit 1
fi
git tag -a {{.CLI_ARGS}} -m "Release {{.CLI_ARGS}}"
git push origin {{.CLI_ARGS}}
echo "Tag {{.CLI_ARGS}} pushed - GitHub Actions will build release"
release:
desc: Run goreleaser locally (snapshot, no publish)
cmds:
- goreleaser release --snapshot --clean
preconditions:
- sh: command -v goreleaser
msg: "goreleaser not installed. Install with: brew install goreleaser"
release-dry:
desc: Dry run goreleaser to check config
cmds:
- goreleaser check
- goreleaser release --snapshot --clean --skip=publish
preconditions:
- sh: command -v goreleaser
msg: "goreleaser not installed. Install with: brew install goreleaser"
version:
desc: Show current version info
cmds:
- 'echo "Version: {{.VERSION}}"'
- 'echo "Commit: {{.COMMIT}}"'
- 'echo "Built: {{.BUILD_DATE}}"'
install:
desc: Install tempo to GOPATH/bin
cmds:
- go install -ldflags "{{.LDFLAGS}}" ./cmd/tempo