Skip to content

Commit 794c5e8

Browse files
authored
Merge pull request #9 from Expensify/cole/bump
add version bump script into action in line
2 parents aecc169 + df6496f commit 794c5e8

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

.github/workflows/version.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,35 @@ jobs:
4949
# Bumps the version and automatically locks and syncs.
5050
- name: Bump version
5151
id: bump-version
52-
run: ./scripts/bump-version.sh
52+
run: |
53+
set -euxo pipefail
54+
55+
CURRENT_VERSION="$(uv version --short)"
56+
readonly CURRENT_VERSION
57+
58+
readonly MAJOR="${CURRENT_VERSION%%.*}"
59+
readonly REMAINING="${CURRENT_VERSION#*.}"
60+
readonly MINOR="${REMAINING%%.*}"
61+
readonly PATCH="${CURRENT_VERSION##*.}"
62+
63+
NEW_MAJOR="$MAJOR"
64+
NEW_MINOR="$MINOR"
65+
NEW_PATCH="$((PATCH + 1))"
66+
67+
if [[ "$NEW_PATCH" -gt 99 ]] ; then
68+
NEW_PATCH=0
69+
NEW_MINOR="$((NEW_MINOR + 1))"
70+
fi
71+
72+
if [[ "$NEW_MINOR" -gt 99 ]] ; then
73+
NEW_MINOR=0
74+
NEW_MAJOR="$((NEW_MAJOR + 1))"
75+
fi
76+
77+
readonly NEW_VERSION="$NEW_MAJOR.$NEW_MINOR.$NEW_PATCH"
78+
79+
# This automatically bumps the version, locks, and syncs.
80+
uv version "$NEW_VERSION"
5381
shell: bash
5482

5583
- name: Created signed commit and push tags

0 commit comments

Comments
 (0)