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