Skip to content

Commit 983003a

Browse files
committed
fix verison incremet
1 parent 72208e2 commit 983003a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/jekyll-gh-pages.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,16 @@ jobs:
4545
- name: Set version
4646
id: version
4747
run: |
48-
VERSION="1.0.${{ github.run_number }}"
48+
# Version scheme: use MAJOR.MINOR from the repo `VERSION` file, and auto-increment PATCH via GitHub run number.
49+
# Example: if `VERSION` contains `1.1.0`, the workflow produces `1.1.<run_number>`.
50+
BASE_VERSION="$(tr -d '\r\n' < VERSION 2>/dev/null || true)"
51+
if [[ ! "$BASE_VERSION" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
52+
echo "ERROR: VERSION must be in SemVer format: MAJOR.MINOR.PATCH (example: 1.1.0). Got: '$BASE_VERSION'" >&2
53+
exit 2
54+
fi
55+
MAJOR="${BASH_REMATCH[1]}"
56+
MINOR="${BASH_REMATCH[2]}"
57+
VERSION="${MAJOR}.${MINOR}.${{ github.run_number }}"
4958
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
5059
echo "$VERSION" > VERSION
5160

0 commit comments

Comments
 (0)