Skip to content

Commit 001c4f2

Browse files
134130claude
andcommitted
chore: update release task in mise.toml
Add version argument validation, dirty working directory check, and automatic git tag + push before running goreleaser. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent eb0aee0 commit 001c4f2

1 file changed

Lines changed: 25 additions & 3 deletions

File tree

mise.toml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,33 @@ go = '1.25'
33
goreleaser = "latest"
44

55
[tasks.release]
6-
run = """
6+
description = "Release a new version. Usage: mise run release -- v1.0.0"
7+
run = '''
78
#!/usr/bin/env bash
89
set -eou pipefail
910
11+
VERSION=${1:-}
12+
if [ -z "$VERSION" ]; then
13+
echo "Usage: mise run release -- <version>"
14+
echo "Example: mise run release -- v1.0.0"
15+
exit 1
16+
fi
17+
18+
if [[ ! "$VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
19+
echo "Error: version must follow vX.Y.Z format (e.g. v1.2.3)"
20+
exit 1
21+
fi
22+
23+
if [ -n "$(git status --porcelain)" ]; then
24+
echo "Error: working directory is dirty. Commit or stash changes before releasing."
25+
git status --short
26+
exit 1
27+
fi
28+
1029
export GITHUB_TOKEN=$(gh auth token)
1130
12-
goreleaser
13-
"""
31+
git tag "$VERSION"
32+
git push origin "$VERSION"
33+
34+
goreleaser release --clean
35+
'''

0 commit comments

Comments
 (0)