Skip to content

Commit

Permalink
🔨 chore: update publish script
Browse files Browse the repository at this point in the history
  • Loading branch information
wangxingkang committed Jan 10, 2022
1 parent 6bcc050 commit 715e753
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions scripts/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,19 @@ const HOOKS_DIR = path.join(__dirname, '../hooks');
const pkgPath = path.join(HOOKS_DIR, pkg);
const {
data: pkgInfo
} = readPackage(path.join(pkgPath, 'package.json'));
} = await readPackage(pkgPath);

if (!pkgInfo || !pkgInfo.name || !pkgInfo.version) return;
if (!pkgInfo || !pkgInfo.name || !pkgInfo.version) {
continue;
};

logger.event(`${pkgInfo.name}`);
await $`cd ${pkgPath}`;

logger.event('git tag');
await $`git tag v${pkgInfo.data.version}`;
await $`git tag ${pkgInfo.name}@${pkgInfo.version}`;
await $`git push origin --tags`;

logger.event('git push');
await $`git push`;

logger.event('pnpm publish');
await $`pnpm publish`;
}
Expand Down

0 comments on commit 715e753

Please sign in to comment.