diff --git a/scripts/RELEASE_PR_TEMPLATE.md.mjs b/scripts/RELEASE_PR_TEMPLATE.md.mjs new file mode 100644 index 000000000..b37db1723 --- /dev/null +++ b/scripts/RELEASE_PR_TEMPLATE.md.mjs @@ -0,0 +1,26 @@ +export default ( { changelog, version }) => ` + +> [!IMPORTANT] +> Merging this PR will build and publish the new version automatically as a GitHub release, then deploy the new version on the WordPress.org plugin repository. +> + +## WP Job Manager ${version} + +> [!NOTE] +> These release notes between the two \`---\` lines will be the final changelog entry for the release. Edit them freely here before merging. +> + +### Release Notes + +--- +${ changelog } +--- + +### Release + +> [!NOTE] +> Click 'Ready for Review', ping the team, review the PR and merge. Upon merging, automation will: +> - Write the release notes above to the changelog +> - Create and tag a new GitHub release +> - Deploy the release to WordPress.org +`; diff --git a/scripts/release-create.mjs b/scripts/release-create.mjs index 22addb028..e84920c01 100644 --- a/scripts/release-create.mjs +++ b/scripts/release-create.mjs @@ -32,29 +32,23 @@ const pluginName = pluginFileContents.match( /Plugin Name: (.*)/ )[ 1 ]; const prNumber = process.argv[ 3 ]; -const releaseNotes = getReleaseChangelog(); - +const releaseNotes = getReleaseNotes(); updateChangelog(); commitChangelog(); tagRelease(); buildPluginZip(); createGithubRelease(); +success(); + +function getReleaseNotes() { -console.log( chalk.bold.green( `✓ ${ pluginName } ${ pluginVersion } released!` ) ); -console.log( `The GitHub release entry will trigger a deploy to WordPress.org. \nTrack here: https://github.com/${ plugin.repo }/actions/workflows/deploy-wporg-release.yml` ); -execSync( ` open https://github.com/${ plugin.repo }/actions/workflows/deploy-wporg-release.yml` ); - -function getReleaseChangelog() { - // Get PR description - const prDescription = execSync( `gh pr view ${ prNumber } -R ${ plugin.repo } --json body` ).toString(); - // Get changelog section - const changelogSection = prDescription.match( /### (?:Changelog|Release Notes)([\S\s]*?)(?:###|