From 2e516fc05d3e49e683985906f917f4bb7c14377a Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Tue, 10 Dec 2024 11:18:10 +0100 Subject: [PATCH] ci: always set version Not only for releases. Signed-off-by: Paul Spooren --- .github/workflows/publish.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1270a894..384d1a2e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -24,11 +24,10 @@ jobs: pip install poetry - name: Set __version__ and poetry version - if: github.event_name == 'release' run: | - TAG="$(git describe --tags --abbrev=0)" - echo "__version__ = \"${TAG##*v}\"" > asu/__init__.py - poetry version "${TAG##*v}" + TAG="$(git describe --tags --always | awk -F"-" '{if (NF>1) {print substr($1, 2)".post"$2} else {print substr($1, 2)}}')" + echo "__version__ = \"$TAG\"" > asu/__init__.py + poetry version "$TAG" - name: Build and publish if: github.event_name == 'release'