We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 26ee705 commit c5ffe46Copy full SHA for c5ffe46
1 file changed
.github/workflows/cd-release.yml
@@ -32,9 +32,19 @@ jobs:
32
- name: Set VERSION variable from tag
33
run: |
34
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
+ # Split main part and prerelease (if any)
+ BASE=$(echo $RAW_VERSION | cut -d- -f1)
+ 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
48
49
- name: Build
50
run: dotnet build --configuration Release /p:Version=${VERSION}
0 commit comments