ci/cd(nightly): correct version for nightly release
This commit is contained in:
@@ -28,18 +28,11 @@ jobs:
|
|||||||
- name: Get version info
|
- name: Get version info
|
||||||
id: version
|
id: version
|
||||||
run: |
|
run: |
|
||||||
BASE=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
|
BASE=$(git describe --tags --abbrev=0 --exclude="*-nightly*" 2>/dev/null || echo "v0.0.0")
|
||||||
if [[ "$BASE" == *"-nightly"* ]]; then
|
VERSION_NUM=${BASE#v}
|
||||||
# already a nightly tag, just strip the suffix
|
|
||||||
NEXT_BASE=${BASE%%-nightly*}
|
|
||||||
else
|
|
||||||
# stable tag, increment patch version
|
|
||||||
CLEAN=${BASE%%-nightly*}
|
|
||||||
VERSION_NUM=${CLEAN#v}
|
|
||||||
IFS='.' read -r major minor patch <<< "$VERSION_NUM"
|
IFS='.' read -r major minor patch <<< "$VERSION_NUM"
|
||||||
patch=$((patch + 1))
|
patch=$((patch + 1))
|
||||||
NEXT_BASE="v${major}.${minor}.${patch}"
|
NEXT_BASE="v${major}.${minor}.${patch}"
|
||||||
fi
|
|
||||||
SHORT=$(git rev-parse --short HEAD)
|
SHORT=$(git rev-parse --short HEAD)
|
||||||
echo "version=${NEXT_BASE}-nightly.${SHORT}" >> $GITHUB_OUTPUT
|
echo "version=${NEXT_BASE}-nightly.${SHORT}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user