Skip to content

Commit dd5fed6

Browse files
authored
Merge pull request #45 from thin-edge/ci-add-release-task
ci: add a release task
2 parents d3de014 + 6e1d8de commit dd5fed6

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

justfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,22 @@ venv:
1818
# Run tests
1919
test *args='':
2020
./.venv/bin/python3 -m robot.run --outputdir output {{args}} tests
21+
22+
# Release
23+
release bump="minor":
24+
#!/bin/bash
25+
set -e
26+
CURRENT_VERSION=$(git tag -l | sort -rV | head -n1)
27+
MAJOR=$(echo "$CURRENT_VERSION" | cut -d. -f1)
28+
MINOR=$(echo "$CURRENT_VERSION" | cut -d. -f2)
29+
PATCH=$(echo "$CURRENT_VERSION" | cut -d. -f3)
30+
case "{{bump}}" in
31+
major) MAJOR=$((MAJOR + 1));;
32+
minor) MINOR=$((MINOR + 1));;
33+
patch) PATCH=$((PATCH + 1));;
34+
esac
35+
echo "Current version: $CURRENT_VERSION"
36+
RELEASE_VERSION="${MAJOR}.${MINOR}.${PATCH}"
37+
echo "Next version: $RELEASE_VERSION"
38+
git tag -a "$RELEASE_VERSION" -m "$RELEASE_VERSION"
39+
git push origin "$RELEASE_VERSION"

0 commit comments

Comments
 (0)