Skip to content

Commit f5634b9

Browse files
committed
fix: Add release changes for builds
1 parent 5db78bf commit f5634b9

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

admin/RELEASE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ the existing content.
124124
* Set the date to format `Release Date: January 31, 2021`
125125
* Update **phpdoc.dist.xml** with the new `<title>CodeIgniter v4.x API</title>`
126126
and `<version number="4.x.x">`
127+
* Update **admin/starter/builds**:
128+
* Set `define('LATEST_RELEASE', '^4.x')`
129+
* Set `define('NEXT_MINOR', '^4.y-dev')`.
130+
* If the major version changes, you need to manually change to `define('NEXT_MINOR', '^5.0-dev')`.
127131
* Commit the changes with `Prep for 4.x.x release`
128132
* [ ] Create a new PR from `release-4.x.x` to `develop`:
129133
* Title: `Prep for 4.x.x release`

admin/prepare-release.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ function replace_file_content(string $path, string $pattern, string $replace): v
2424
$versionParts = explode('.', $version);
2525
$minor = $versionParts[0] . '.' . $versionParts[1];
2626

27+
// Note: Major version will change someday (4.x..5.x) - update manually.
28+
$nextVersion = $versionParts[0] . '.' . $versionParts[1] + 1;
29+
2730
// Creates a branch for release.
2831
system('git switch develop');
2932
system('git branch -D release-' . $version);
@@ -68,6 +71,18 @@ function replace_file_content(string $path, string $pattern, string $replace): v
6871
"Release Date: {$date}",
6972
);
7073

74+
// Update appstarter/builds script
75+
replace_file_content(
76+
'./admin/starter/builds',
77+
'/define\(\'LATEST_RELEASE\', \'.*?\'\);/mu',
78+
"define('LATEST_RELEASE', '^{$minor}');",
79+
);
80+
replace_file_content(
81+
'./admin/starter/builds',
82+
'/define\(\'NEXT_MINOR\', \'.*?\'\);/mu',
83+
"define('NEXT_MINOR', '^{$nextVersion}-dev');",
84+
);
85+
7186
// Commits
7287
system('git add -u');
7388
system('git commit -m "Prep for ' . $version . ' release"');

0 commit comments

Comments
 (0)