Skip to content

Commit

Permalink
Release Script: Replace @since versions (#1221)
Browse files Browse the repository at this point in the history
* Update regex

* Release Script: Replace @SInCE versions

Also fixes migration regex

* Revert test changes
obenland authored Jan 27, 2025
1 parent 3a9c3c2 commit 5f73af8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion bin/release.js
Original file line number Diff line number Diff line change
@@ -99,11 +99,22 @@ async function createRelease(version) {

updateVersionInFile('includes/class-migration.php', version, [
{
search: /version_compare\([^,]+,\s*['"]unreleased['"]/gi,
search: /(?<!\*[\s\S]{0,50})(?<=version_compare\s*\(\s*\$version_from_db,\s*')unreleased(?=',\s*['<=>])/g,
replace: (match) => match.replace(/unreleased/i, version)
}
]);

const phpFiles = execWithOutput('find . -name "*.php"').split('\n');

phpFiles.forEach((filePath) => {
updateVersionInFile(filePath, version, [
{
search: /@since unreleased/g,
replace: `@since ${version}`
}
]);
});

// Update CHANGELOG.md
updateChangelog(version);

0 comments on commit 5f73af8

Please sign in to comment.