Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 8 additions & 24 deletions .github/workflows/devforge-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -253,24 +245,16 @@ 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
fi

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
Expand Down
14 changes: 7 additions & 7 deletions backend/config/constants.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

$devforgeConstants = [
$config = [
'coolify' => [
'version' => '4.1.13',
'helper_version' => 'helper',
'realtime_version' => 'realtime',
Expand All @@ -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',
Expand Down Expand Up @@ -152,3 +148,7 @@
'notification_delay_scaling' => 0.2,
],
];

$config['devforge'] = $config['coolify'];

return $config;