Create new branch in release script (#1423)

This commit is contained in:
Chenlei Hu
2024-11-04 09:02:33 -05:00
committed by GitHub
parent 56b63ebab5
commit 09d5e29f01

View File

@@ -2,6 +2,13 @@ import { execSync } from 'child_process'
import { readFileSync } from 'fs'
try {
// Create a new branch with version-bump prefix
console.log('Creating new branch...')
const date = new Date().toISOString().split('T')[0]
const timestamp = new Date().getTime()
const branchName = `version-bump-${date}-${timestamp}`
execSync(`git checkout -b ${branchName} -t origin/main`, { stdio: 'inherit' })
// Run npm version patch and capture the output
console.log('Bumping version...')
execSync('npm version patch', { stdio: 'inherit' })