Skip to content

Commit c5ffe46

Browse files
committed
#147 retry fix version issue
1 parent 26ee705 commit c5ffe46

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

.github/workflows/cd-release.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,19 @@ jobs:
3232
- name: Set VERSION variable from tag
3333
run: |
3434
RAW_VERSION=${GITHUB_REF/refs\/tags\/v/}
35-
# Strip leading zeros from numeric identifiers in pre-release section
36-
SANITIZED_VERSION=$(echo $RAW_VERSION | perl -pe 's/\.0*([0-9]+)/.\1/g')
37-
echo "VERSION=$SANITIZED_VERSION" >> $GITHUB_ENV
35+
# Split main part and prerelease (if any)
36+
BASE=$(echo $RAW_VERSION | cut -d- -f1)
37+
PRE=$(echo $RAW_VERSION | cut -s -d- -f2-)
38+
39+
if [ -n "$PRE" ]; then
40+
# Replace .00xx with .xx (strip leading zeros)
41+
PRE=$(echo $PRE | sed -E 's/\.0+([0-9]+)/.\1/g')
42+
VERSION="$BASE-$PRE"
43+
else
44+
VERSION="$BASE"
45+
fi
46+
47+
echo "VERSION=$VERSION" >> $GITHUB_ENV
3848
3949
- name: Build
4050
run: dotnet build --configuration Release /p:Version=${VERSION}

0 commit comments

Comments
 (0)