This repository was archived by the owner on Feb 17, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
115 lines (96 loc) · 3.17 KB
/
justfile
File metadata and controls
115 lines (96 loc) · 3.17 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
# List available commands
default:
@just --list
# Bump version by patch and create git tag
bump-patch:
@just bump-and-tag patch
# Bump version by minor and create git tag
bump-minor:
@just bump-and-tag minor
# Bump version by major and create git tag
bump-major:
@just bump-and-tag major
# Internal recipe to bump version and create git tag
bump-and-tag type:
#!/usr/bin/env bash
# Check if the repo is clean
if [[ -n $(git status --porcelain) ]]; then
echo "Error: Git repository has uncommitted changes. Please commit or stash them first."
exit 1
fi
# Get the current version before bumping
OLD_VERSION=$(uv version --short)
echo "Current version: $OLD_VERSION"
# Bump the version
echo "Bumping {{ type }} version..."
uv version --bump {{ type }}
# Get the new version
NEW_VERSION=$(uv version --short)
echo "New version: $NEW_VERSION"
# Run uv sync to update the lock file
echo "Updating lock file with uv sync..."
uv sync
# Commit both the pyproject.toml and lock file changes in one commit
git add pyproject.toml
git add .
git commit -m "Bump version: $OLD_VERSION → $NEW_VERSION"
# Create tag directly rather than calling another recipe
VERSION=$NEW_VERSION
TAG="v$VERSION"
# Check if tag already exists
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "Tag $TAG already exists. Skipping tag creation."
else
echo "Creating git tag $TAG..."
git tag -a "$TAG" -m "Version $VERSION"
echo "Created git tag: $TAG"
echo "To push the tag, run: git push origin $TAG"
fi
# Create git tag from current version if it doesn't exist
tag-version:
#!/usr/bin/env bash
VERSION=$(uv version --short)
TAG="v$VERSION"
# Check if tag already exists
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "Tag $TAG already exists. Skipping tag creation."
else
echo "Creating git tag $TAG..."
git tag -a "$TAG" -m "Version $VERSION"
echo "Created git tag: $TAG"
echo "To push the tag, run: git push origin $TAG"
fi
# Push the latest version tag to remote
push-tag:
#!/usr/bin/env bash
VERSION=$(uv version --short)
TAG="v$VERSION"
# Check if tag exists locally
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "Pushing tag $TAG to remote..."
git push origin "$TAG"
echo "Tag $TAG pushed successfully!"
else
echo "Tag $TAG does not exist locally. Create it first with 'just tag-version'."
exit 1
fi
# Push both commits and tag to remote
push-all:
#!/usr/bin/env bash
VERSION=$(uv version --short)
TAG="v$VERSION"
# Push commits
echo "Pushing commits to remote..."
git push
# Check if tag exists locally
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "Pushing tag $TAG to remote..."
git push origin "$TAG"
echo "All changes pushed successfully!"
else
echo "Tag $TAG does not exist locally. Create it first with 'just tag-version'."
exit 1
fi
# Show current version
version:
@uv version --short