Skip to content

Commit

Permalink
refactor: remove versionCmd and commit match
Browse files Browse the repository at this point in the history
  • Loading branch information
danstarns committed Oct 22, 2024
1 parent a1349bb commit f854486
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions scripts/releaseDocs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@ async function prepareCoreRelease() {
'You have uncommitted changes. Please commit or stash them before running the release script.',
);

// Increment the Core version
const versionCmd = releaseTag === 'latest' ? 'patch' : `prerelease --preid ${releaseTag}`;
runCommand(`pnpm --filter @grapesjs/docs exec npm version ${versionCmd} --no-git-tag-version --no-commit-hooks`);
// Increment the docs version
runCommand(`pnpm --filter @grapesjs/docs exec npm version patch --no-git-tag-version --no-commit-hooks`);

// Create a new release branch
const newVersion = JSON.parse(fs.readFileSync(`${pathLib}/package.json`, 'utf8')).version;
const newBranch = `release-docs-v${newVersion}`;
runCommand(`git checkout -b ${newBranch}`);
runCommand('git add .');
runCommand(`git commit -m "Release GrapesJS docs ${releaseTag}: v${newVersion}"`);
runCommand(`git commit -m "Release GrapesJS docs: v${newVersion}"`);

console.log(`Release prepared! Push the current "${newBranch}" branch and open a new PR targeting 'dev'`);
} catch (error) {
Expand Down

0 comments on commit f854486

Please sign in to comment.