File: release.sh

package info (click to toggle)
python-rdflib-endpoint 0.5.4-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 744 kB
  • sloc: python: 1,197; sh: 21; makefile: 5
file content (26 lines) | stat: -rwxr-xr-x 675 bytes parent folder | download
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
#!/bin/bash

# Validate version bump type
BUMP_TYPE=$1
if [ -z "$BUMP_TYPE" ] || { [ "$BUMP_TYPE" != "fix" ] && [ "$BUMP_TYPE" != "minor" ] && [ "$BUMP_TYPE" != "major" ]; }; then
    echo "Error: Version bump type is required and must be one of: fix, minor, major"
    echo "Usage: $0 <fix|minor|major>"
    exit 1
fi

uvx hatch version $BUMP_TYPE

VERSION=$(uvx hatch version)

uvx git-cliff -o CHANGELOG.md --tag v$VERSION
git add CHANGELOG.md src/*/__init__.py
git commit -m "Bump to v$VERSION"
git tag -a "v$VERSION" -m "Release v$VERSION"
git push origin "v$VERSION"

rm -rf dist
uv build
uv publish

# If `uv publish` is broken:
# uvx hatch build && uvx hatch publish