generated from ryansonshine/typescript-npm-package-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): improve postVersion script
- Loading branch information
Showing
1 changed file
with
9 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}`); |