Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion .github/workflows/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,35 @@ jobs:
# Bumps the version and automatically locks and syncs.
- name: Bump version
id: bump-version
run: ./scripts/bump-version.sh
run: |
set -euxo pipefail

CURRENT_VERSION="$(uv version --short)"
readonly CURRENT_VERSION

readonly MAJOR="${CURRENT_VERSION%%.*}"
readonly REMAINING="${CURRENT_VERSION#*.}"
readonly MINOR="${REMAINING%%.*}"
readonly PATCH="${CURRENT_VERSION##*.}"

NEW_MAJOR="$MAJOR"
NEW_MINOR="$MINOR"
NEW_PATCH="$((PATCH + 1))"

if [[ "$NEW_PATCH" -gt 99 ]] ; then
NEW_PATCH=0
NEW_MINOR="$((NEW_MINOR + 1))"
fi

if [[ "$NEW_MINOR" -gt 99 ]] ; then
NEW_MINOR=0
NEW_MAJOR="$((NEW_MAJOR + 1))"
fi

readonly NEW_VERSION="$NEW_MAJOR.$NEW_MINOR.$NEW_PATCH"

# This automatically bumps the version, locks, and syncs.
uv version "$NEW_VERSION"
shell: bash

- name: Created signed commit and push tags
Expand Down