Skip to content

Commit

Permalink
update script
Browse files Browse the repository at this point in the history
  • Loading branch information
marikaner committed Sep 11, 2024
1 parent 23b2af6 commit 9969672
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 18 deletions.
19 changes: 10 additions & 9 deletions .github/actions/changesets-fixed-version-bump/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 12 additions & 9 deletions build-packages/changesets-fixed-version-bump/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ async function bump() {
const version = await getNextVersion();
info(`Bumping to version ${version}`);
process.env.NEXT_PACKAGE_VERSION = version;
const beforeBumpScript = getInput('before-bump');
info(`executing before script`);
if (beforeBumpScript) {
await command(beforeBumpScript);
}
await executeCustomScript(getInput('before-bump'));

info(`updating root package.json`);
await updateRootPackageJson(version);
Expand All @@ -26,10 +22,8 @@ async function bump() {

// after bump
info(`executing after script`);
const afterBumpScript = getInput('after-bump');
if (afterBumpScript) {
await command(afterBumpScript);
}
await executeCustomScript(getInput('after-bump'));

await commitAndTag(version).catch(err => {
error(err);
process.exit(1);
Expand Down Expand Up @@ -58,4 +52,13 @@ async function commitAndTag(version: string) {
await command('git push'); // --follow-tags');
}

async function executeCustomScript(script: string) {
if (script) {
const commands = script.split('\n');
for (const cmd of commands) {
await command(cmd);
}
}
}

bump();

0 comments on commit 9969672

Please sign in to comment.