-
Notifications
You must be signed in to change notification settings - Fork 2k
feat: Add builds next option
#9946
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,7 +1,9 @@ | ||||||
| #!/usr/bin/env php | ||||||
| <?php | ||||||
|
|
||||||
| define('LATEST_RELEASE', '^4.0'); | ||||||
| define('LATEST_RELEASE', '^4.7'); | ||||||
| define('DEVELOP_BRANCH', 'dev-develop'); | ||||||
| define('NEXT_MINOR', '4.8-dev'); | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Re-adding the caret.
Suggested change
|
||||||
| define('GITHUB_URL', 'https://github.com/codeigniter4/codeigniter4'); | ||||||
|
|
||||||
| /* | ||||||
|
|
@@ -11,18 +13,18 @@ define('GITHUB_URL', 'https://github.com/codeigniter4/codeigniter4'); | |||||
| * Use this script to toggle the CodeIgniter dependency between the | ||||||
| * latest stable release and the most recent development update. | ||||||
| * | ||||||
| * Usage: php builds [release|development] | ||||||
| * Usage: php builds [release|development|next] | ||||||
| */ | ||||||
|
|
||||||
| $branch = $argv[1] ?? ''; | ||||||
|
|
||||||
| // Determine the requested stability | ||||||
| if (empty($argv[1]) || ! in_array($argv[1], ['release', 'development'], true)) { | ||||||
| echo 'Usage: php builds [release|development]' . PHP_EOL; | ||||||
| if ($branch === '' || ! in_array($branch, ['release', 'development', 'next'], true)) { | ||||||
| echo 'Usage: php builds [release|development|next]' . PHP_EOL; | ||||||
|
|
||||||
| exit; | ||||||
| } | ||||||
|
|
||||||
| $dev = $argv[1] === 'development'; | ||||||
|
|
||||||
| $modified = []; | ||||||
|
|
||||||
| // Locate each file and update it for the requested stability | ||||||
|
|
@@ -36,7 +38,7 @@ if (is_file($file)) { | |||||
| $array = json_decode($contents, true); | ||||||
|
|
||||||
| if (is_array($array)) { | ||||||
| if ($dev) { | ||||||
| if ($branch !== 'release') { | ||||||
| $array['minimum-stability'] = 'dev'; | ||||||
| $array['prefer-stable'] = true; | ||||||
| $array['repositories'] ??= []; | ||||||
|
|
@@ -57,7 +59,7 @@ if (is_file($file)) { | |||||
| ]; | ||||||
| } | ||||||
|
|
||||||
| $array['require']['codeigniter4/codeigniter4'] = 'dev-develop'; | ||||||
| $array['require']['codeigniter4/codeigniter4'] = $branch === 'next' ? NEXT_MINOR : DEVELOP_BRANCH; | ||||||
| unset($array['require']['codeigniter4/framework']); | ||||||
| } else { | ||||||
| unset($array['minimum-stability']); | ||||||
|
|
@@ -70,7 +72,7 @@ if (is_file($file)) { | |||||
| } | ||||||
| } | ||||||
|
|
||||||
| if (empty($array['repositories'])) { | ||||||
| if ($array['repositories'] === []) { | ||||||
| unset($array['repositories']); | ||||||
| } | ||||||
| } | ||||||
|
|
@@ -100,7 +102,7 @@ foreach ($files as $file) { | |||||
| if (is_file($file)) { | ||||||
| $contents = file_get_contents($file); | ||||||
|
|
||||||
| if ($dev) { | ||||||
| if ($branch !== 'release') { | ||||||
| $contents = str_replace('vendor/codeigniter4/framework', 'vendor/codeigniter4/codeigniter4', $contents); | ||||||
| } else { | ||||||
| $contents = str_replace('vendor/codeigniter4/codeigniter4', 'vendor/codeigniter4/framework', $contents); | ||||||
|
|
@@ -120,6 +122,7 @@ if ($modified === []) { | |||||
| foreach ($modified as $file) { | ||||||
| echo " * {$file}" . PHP_EOL; | ||||||
| } | ||||||
|
|
||||||
| echo 'Run `composer update` to sync changes with your vendor folder.' . PHP_EOL; | ||||||
| } | ||||||
|
|
||||||
| echo 'Run `composer update` to sync changes with your vendor folder.' . PHP_EOL; | ||||||
| echo 'Don\'t forget to update the project files in app folder from "vendor/codeigniter4/*/app/".' . PHP_EOL; | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -158,6 +158,8 @@ Folders in your project after set up: | |
| - app, public, tests, writable | ||
| - vendor/codeigniter4/framework/system | ||
|
|
||
| .. _switch-to-dev-version: | ||
|
|
||
| Latest Dev | ||
| ---------- | ||
|
|
||
|
|
@@ -169,6 +171,9 @@ The `development user guide <https://codeigniter4.github.io/CodeIgniter4/>`_ is | |
| Note that this differs from the released user guide, and will pertain to the | ||
| develop branch explicitly. | ||
|
|
||
| .. note:: You should not rely on the version of the framework in your project | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Off-topic for another PR, maybe? Should "unstable" versions have a suffixed
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like version_compare() would handle this without a problem, so if we can automate this, then why not? Without automation, we would probably forget about it in a few weeks. |
||
| - the development code may contain an incorrect number. | ||
|
|
||
| Update for Latest Dev | ||
| ^^^^^^^^^^^^^^^^^^^^^ | ||
|
|
||
|
|
@@ -188,15 +193,11 @@ files if necessary. | |
| Next Minor Version | ||
| ^^^^^^^^^^^^^^^^^^ | ||
|
|
||
| If you want to use the next minor version branch, after using the ``builds`` command | ||
| edit **composer.json** manually. | ||
| If you want to use the next minor version branch: | ||
|
|
||
| If you try the ``4.8`` branch, change the version to ``4.8.x-dev``:: | ||
| .. code-block:: console | ||
|
|
||
| "require": { | ||
| "php": "^8.2", | ||
| "codeigniter4/codeigniter4": "4.8.x-dev" | ||
| }, | ||
| php builds next | ||
|
|
||
| And run ``composer update`` to sync your vendor | ||
| folder with the latest target build. Then, check the Upgrading Guide | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.