-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #716 from codeigniter4/develop
1.0.0-beta.6 Ready code
- Loading branch information
Showing
53 changed files
with
2,846 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# Release Process | ||
|
||
> Documentation guide based on the releases of `1.0.0-beta.5` on March 17, 2023. | ||
> | ||
> -kenjis | ||
## Changelog | ||
|
||
When generating the changelog each Pull Request to be included must have one of | ||
the following [labels](https://github.com/codeigniter4/shield/labels): | ||
- **bug** ... PRs that fix bugs | ||
- **enhancement** ... PRs to improve existing functionalities | ||
- **new feature** ... PRs for new features | ||
- **refactor** ... PRs to refactor | ||
- **lang** ... PRs for new/update language | ||
|
||
PRs with breaking changes must have the following additional label: | ||
- **breaking change** ... PRs that may break existing functionalities | ||
|
||
### Check Generated Changelog | ||
|
||
This process is checking only. Do not create a release. | ||
|
||
To auto-generate, navigate to the | ||
[Releases](https://github.com/codeigniter4/shield/releases) page, | ||
click the "Draft a new release" button. | ||
|
||
* Tag: "v1.0.0-beta.5" (Create new tag) | ||
* Target: develop | ||
|
||
Click the "Generate release notes" button. | ||
|
||
Check the resulting content. If there are items in the *Others* section which | ||
should be included in the changelog, add a label to the PR and regenerate | ||
the changelog. | ||
|
||
## Preparation | ||
|
||
* Clone **codeigniter4/shield** and resolve any necessary PRs | ||
```console | ||
git clone [email protected]:codeigniter4/shield.git | ||
``` | ||
* Merge any Security Advisory PRs in private forks | ||
|
||
## Process | ||
|
||
> **Note** Most changes that need noting in the User Guide and docs should have | ||
> been included with their PR, so this process assumes you will not be | ||
> generating much new content. | ||
|
||
* Create a new branch `release-1.x.x` | ||
* Update **src/Auth.php** with the new version number: | ||
`const SHIELD_VERSION = '1.x.x';` | ||
* Commit the changes with "Prep for 1.x.x release" and push to origin | ||
* Create a new PR from `release-1.x.x` to `develop`: | ||
* Title: "Prep for 1.x.x release" | ||
* Description: "Updates version references for `1.x.x`." (plus checklist) | ||
* Let all tests run, then review and merge the PR | ||
* Create a new PR from `develop` to `master`: | ||
* Title: "1.x.x Ready code" | ||
* Description: blank | ||
* Merge the PR | ||
* Create a new Release: | ||
* Version: "v1.x.x" | ||
* Target: master | ||
* Title: "v1.x.x" | ||
* Click the "Generate release notes" button | ||
* Remove "### Others (Only for checking. Remove this category)" section | ||
* Check "Create a discussion for this release" | ||
* Click the "Publish release" button | ||
* Watch for the "docs" action and verify that the user guide updated: | ||
* [docs](https://github.com/codeigniter4/shield/actions/workflows/docs.yml) | ||
* Fast-forward `develop` branch to catch the merge commit from `master` | ||
(note: pushing to develop is restricted to administrators): | ||
```console | ||
git fetch origin | ||
git checkout develop | ||
git merge origin/develop | ||
git merge origin/master | ||
git push origin HEAD # Only administrators can push to the protected branch. | ||
``` | ||
* Publish any Security Advisories that were resolved from private forks | ||
(note: publishing is restricted to administrators) | ||
* Announce the release on the forums and Slack channel | ||
(note: this forum is restricted to administrators): | ||
* Make a new topic in the "News & Discussion" forums: | ||
https://forum.codeigniter.com/forum-2.html | ||
* The content is somewhat organic, but should include any major features and | ||
changes as well as a link to the User Guide's changelog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
#!/usr/bin/env php | ||
<?php declare(strict_types=1); | ||
|
||
/** | ||
* This file is part of CodeIgniter 4 framework. | ||
* | ||
* (c) CodeIgniter Foundation <[email protected]> | ||
* | ||
* For the full copyright and license information, please view | ||
* the LICENSE file that was distributed with this source code. | ||
*/ | ||
|
||
require __DIR__ . '/../vendor/codeigniter4/framework/system/Test/bootstrap.php'; | ||
|
||
use CodeIgniter\CLI\CLI; | ||
|
||
helper('filesystem'); | ||
|
||
if ($argc !== 2) { | ||
CLI::error('Please specify a locale.'); | ||
|
||
exit(1); | ||
} | ||
|
||
$locale = $argv[1]; | ||
|
||
$langDir = realpath(__DIR__ . '/../src/Language/' . $locale); | ||
|
||
if (! is_dir($langDir)) { | ||
CLI::error('No such directory: "' . $langDir . '"'); | ||
|
||
exit(1); | ||
} | ||
|
||
$enDir = realpath(__DIR__ . '/../src/Language/en'); | ||
|
||
if (! is_dir($enDir)) { | ||
CLI::error('No "Language/en" directory. Please run "composer update".'); | ||
|
||
exit(1); | ||
} | ||
|
||
$files = get_filenames( | ||
$langDir, | ||
true, | ||
false, | ||
false | ||
); | ||
|
||
$enFiles = get_filenames( | ||
$enDir, | ||
true, | ||
false, | ||
false | ||
); | ||
|
||
foreach ($enFiles as $enFile) { | ||
$temp = $langDir . '/' . substr($enFile, strlen($enDir) + 1); | ||
$langFile = realpath($temp) ?: $temp; | ||
|
||
if (! is_file($langFile)) { | ||
CLI::error('No such file: "' . $langFile . '"'); | ||
|
||
continue; | ||
} | ||
|
||
$enFileLines = file($enFile); | ||
|
||
$items = []; | ||
|
||
$pattern = '/(.*)\'([a-zA-Z0-9_]+?)\'(\s*=>\s*)([\'"].+[\'"]),/u'; | ||
|
||
foreach ($enFileLines as $line) { | ||
if (preg_match($pattern, $line, $matches)) { | ||
$items[] = [$matches[2] => $matches[4]]; | ||
} | ||
} | ||
|
||
$langFileLines = file($langFile); | ||
|
||
$newLangFile = ''; | ||
|
||
$itemNo = 0; | ||
|
||
foreach ($langFileLines as $line) { | ||
// Remove en value comment. | ||
if (preg_match('!(.*,)(\s*//.*)$!u', $line, $matches)) { | ||
$line = $matches[1] . "\n"; | ||
} | ||
|
||
if (preg_match($pattern, $line, $matches) === 0) { | ||
$newLangFile .= $line; | ||
} else { | ||
$indent = $matches[1]; | ||
$key = $matches[2]; | ||
$arrow = $matches[3]; | ||
$value = $matches[4]; | ||
|
||
$newLangFile .= $indent . "'" . $key . "'" . $arrow . $value | ||
. ', // ' . $items[$itemNo][array_key_first($items[$itemNo])] . "\n"; | ||
$itemNo++; | ||
} | ||
} | ||
|
||
file_put_contents($langFile, $newLangFile); | ||
CLI::write('Updated: ' . $langFile); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.