Skip to content

Commit

Permalink
chore(ci): improve postVersion script
Browse files Browse the repository at this point in the history
  • Loading branch information
smellai committed Jul 4, 2024
1 parent a4777ed commit 3b69aec
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions repo-scripts/npm-postVersion.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import childProcess, { execSync } from 'child_process';
import fs from 'fs';
import childProcess from 'child_process';
import { PackageJson } from 'type-fest';

const branchName = execSync('git rev-parse --abbrev-ref HEAD')
.toString('utf-8')
.trim();
// TODO - analyze commits and use commit messages to annotate tag?

childProcess.execSync(`git push -u origin ${branchName} --tags `);
const packageJson: PackageJson = JSON.parse(
fs.readFileSync('package.json').toString()
);

childProcess.execSync(`git push origin v${packageJson.version}`);

0 comments on commit 3b69aec

Please sign in to comment.