From 2a412e751238736f914e93f988df3071fe0ddcab Mon Sep 17 00:00:00 2001 From: verse91 Date: Tue, 23 Jun 2026 10:33:19 +0700 Subject: [PATCH] ci/cd(nightly): correct version for nightly release --- .github/workflows/nightly.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 362fa16..ea2e05f 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -29,9 +29,19 @@ jobs: id: version run: | BASE=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0") - BASE=${BASE%%-nightly*} + if [[ "$BASE" == *"-nightly"* ]]; then + # 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" + patch=$((patch + 1)) + NEXT_BASE="v${major}.${minor}.${patch}" + fi SHORT=$(git rev-parse --short HEAD) - echo "version=${BASE}-nightly.${SHORT}" >> $GITHUB_OUTPUT + echo "version=${NEXT_BASE}-nightly.${SHORT}" >> $GITHUB_OUTPUT - name: Build Binaries run: |