From 25932b8d417b851565c77f88e47eeb677a5f2a43 Mon Sep 17 00:00:00 2001 From: Mathieu JESER Date: Fri, 28 Aug 2026 17:11:43 +0200 Subject: [PATCH] fix: Hub version parse after constants.devforge alias --- .github/workflows/devforge-images.yml | 32 +++++++-------------------- backend/config/constants.php | 14 ++++++------ 2 files changed, 15 insertions(+), 31 deletions(-) diff --git a/.github/workflows/devforge-images.yml b/.github/workflows/devforge-images.yml index 2d36d1eed5..92023817b5 100644 --- a/.github/workflows/devforge-images.yml +++ b/.github/workflows/devforge-images.yml @@ -58,10 +58,10 @@ jobs: - name: Compute next version id: compute run: | - # Read current version from constants.php (coolify.version line only) - CURRENT=$(awk -F"'" '/coolify.*=>.*\[/,/\]/ { if (/'\''version'\''/) { print $4; exit } }' backend/config/constants.php) + # First 'version' => 'x.y.z' in constants.php (coolify or devforge) + CURRENT=$(grep -m1 -E "'version' => '[0-9]+\.[0-9]+\.[0-9]+'" backend/config/constants.php | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1) if [ -z "$CURRENT" ]; then - echo "Error: Could not extract coolify.version from constants.php" + echo "Error: Could not extract version from constants.php" exit 1 fi echo "Current version: $CURRENT" @@ -113,16 +113,8 @@ jobs: NEW_VERSION="${{ needs.prepare.outputs.version }}" echo "Patching version: $CURRENT -> $NEW_VERSION" - # Update backend/config/constants.php (coolify.version only) - awk -v old="$CURRENT" -v new="$NEW_VERSION" ' - /coolify.*=>.*\[/,/\]/ { - if (/'\''version'\'' =>/) { - sub(old, new) - } - } - { print } - ' backend/config/constants.php > backend/config/constants.php.tmp - mv backend/config/constants.php.tmp backend/config/constants.php + # Update backend/config/constants.php (first version assignment) + sed -i "s/'version' => '${CURRENT}'/'version' => '${NEW_VERSION}'/" backend/config/constants.php # Update backend/versions.json (all matching DevForge version fields) sed -i "s/\"version\": \"${CURRENT}\"/\"version\": \"${NEW_VERSION}\"/g" backend/versions.json @@ -253,7 +245,7 @@ jobs: NEW_VERSION="${{ needs.prepare.outputs.version }}" # Check if files already have the new version (idempotent) - EXISTING=$(awk -F"'" '/coolify.*=>.*\[/,/\]/ { if (/'\''version'\''/) { print $4; exit } }' backend/config/constants.php) + EXISTING=$(grep -m1 -E "'version' => '[0-9]+\.[0-9]+\.[0-9]+'" backend/config/constants.php | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1) if [ "$EXISTING" = "$NEW_VERSION" ]; then echo "Version already at $NEW_VERSION, skipping commit" exit 0 @@ -261,16 +253,8 @@ jobs: echo "Updating GitHub main: $CURRENT -> $NEW_VERSION" - # Update backend/config/constants.php (coolify.version only) - awk -v old="$CURRENT" -v new="$NEW_VERSION" ' - /coolify.*=>.*\[/,/\]/ { - if (/'\''version'\'' =>/) { - sub(old, new) - } - } - { print } - ' backend/config/constants.php > backend/config/constants.php.tmp - mv backend/config/constants.php.tmp backend/config/constants.php + # Update backend/config/constants.php (first version assignment) + sed -i "s/'version' => '${CURRENT}'/'version' => '${NEW_VERSION}'/" backend/config/constants.php # Update backend/versions.json (all matching DevForge version fields) sed -i "s/\"version\": \"${CURRENT}\"/\"version\": \"${NEW_VERSION}\"/g" backend/versions.json diff --git a/backend/config/constants.php b/backend/config/constants.php index 53ce9c9e61..8617c469cc 100644 --- a/backend/config/constants.php +++ b/backend/config/constants.php @@ -1,6 +1,7 @@ [ 'version' => '4.1.13', 'helper_version' => 'helper', 'realtime_version' => 'realtime', @@ -16,12 +17,7 @@ 'versions_url' => env('VERSIONS_URL', 'https://raw.githubusercontent.com/bobdivx/devforge-store/main/versions.json'), 'upgrade_script_url' => env('UPGRADE_SCRIPT_URL', 'https://raw.githubusercontent.com/bobdivx/devforge/main/scripts/upgrade.sh'), 'releases_url' => env('RELEASES_URL', 'https://raw.githubusercontent.com/coollabsio/coolify-cdn/main/json/releases.json'), -]; - -return [ - 'devforge' => $devforgeConstants, - // BC alias for legacy config('constants.coolify.*') - 'coolify' => $devforgeConstants, + ], 'urls' => [ 'docs' => 'https://github.com/bobdivx/devforge', @@ -152,3 +148,7 @@ 'notification_delay_scaling' => 0.2, ], ]; + +$config['devforge'] = $config['coolify']; + +return $config;