fix: Minor component and version format fixes

This commit is contained in:
Ginger 2025-09-08 13:13:47 -04:00
commit 863239f341
No known key found for this signature in database

View file

@ -72,18 +72,21 @@ jobs:
# VERSION is the package version, COMPONENT is used in # VERSION is the package version, COMPONENT is used in
# apt's repository config like a git repo branch # apt's repository config like a git repo branch
if [[ "${{ forge.ref }}" == "refs/tags/"* ]]; then if [[ "${{ forge.ref }}" == "refs/tags/"* ]]; then
# Use the "stable" component for tagged releases
COMPONENT="stable" COMPONENT="stable"
VERSION=$BASE_VERSION VERSION=$BASE_VERSION
else else
# Use the "dev" component for development builds
SHA=$(echo "${{ forge.sha }}" | cut -c1-7) SHA=$(echo "${{ forge.sha }}" | cut -c1-7)
DATE=$(date +%Y%m%d) DATE=$(date +%Y%m%d)
if [ "${{ forge.ref_name }}" = "main" ]; then if [ "${{ forge.ref_name }}" = "main" ]; then
COMPONENT="dev" COMPONENT="dev"
else else
# Use sanitized ref name for the component # Use the sanitized ref name as the component for feature branches
COMPONENT=$(echo "${{ forge.ref_name }}" | sed 's/[^a-zA-Z0-9.+]/~/g' | tr '[:upper:]' '[:lower:]' | cut -c1-30) COMPONENT="dev/$(echo "${{ forge.ref_name }}" | sed 's/[^a-zA-Z0-9.+/]/-/g' | tr '[:upper:]' '[:lower:]' | cut -c1-30)""
fi fi
VERSION="$BASE_VERSION~git$DATE.$SHA-$COMPONENT" CLEAN_COMPONENT=$(echo $COMPONENT | sed 's/[^a-zA-Z0-9.+]/~/g')
VERSION="$BASE_VERSION~git$DATE.$SHA-$CLEAN_COMPONENT"
fi fi
echo "component=$COMPONENT" >> $GITHUB_OUTPUT echo "component=$COMPONENT" >> $GITHUB_OUTPUT
echo "version=$VERSION" >> $GITHUB_OUTPUT echo "version=$VERSION" >> $GITHUB_OUTPUT