Skip to content

Commit da76eab

Browse files
committed
Ensure arbitrary versions via workflow_dispatch are working correctly
1 parent 53898cb commit da76eab

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,10 @@ jobs:
113113
else
114114
VERSION=${GITHUB_REF#refs/tags/v}
115115
fi
116-
# Normalize version for Debian (replace hyphens, ensure it starts with a digit)
117-
DEB_VERSION=$(echo "$VERSION" | sed 's/^v//')
116+
# Normalize to a valid Debian version: strip leading 'v', replace
117+
# characters illegal in dpkg versions, and prefix with '0~' when the
118+
# result doesn't start with a digit (Debian convention for pre-release)
119+
DEB_VERSION=$(echo "$VERSION" | awk '{sub(/^v/,""); gsub(/[^A-Za-z0-9.+~-]/,"."); if ($0 !~ /^[0-9]/) $0="0~"$0; print}')
118120
echo "version=${DEB_VERSION}" >> $GITHUB_OUTPUT
119121
120122
- name: Build .deb package

0 commit comments

Comments
 (0)