From 21590b8d043c5b9528749c6f3bc578f1c41856cb Mon Sep 17 00:00:00 2001 From: phnx47-bot <78849906+phnx47-bot@users.noreply.github.com> Date: Sat, 30 Dec 2023 19:45:54 +0700 Subject: [PATCH] ci: zero dev version (#119) --- .github/workflows/ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4c1b441..d3c1f1b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,7 +45,12 @@ jobs: - name: Set Dev version if: github.ref == 'refs/heads/main' - run: echo "VERSION=$(git describe --long --tags | sed 's/^v//;0,/-/s//./')" >> $GITHUB_ENV + run: | + version="$(git describe --long --tags | sed 's/^v//;0,/-/s//./')" + if [ -z "${version}" ]; then + version="0.0.0.$(git rev-list --count HEAD)-g$(git rev-parse --short HEAD)" + fi + echo "VERSION=${version}" >> $GITHUB_ENV - name: Set Release version if: startsWith(github.ref, 'refs/tags/v')