File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments