Skip to content

Commit

Permalink
Create new branch in release script (#1423)
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei authored Nov 4, 2024
1 parent 56b63eb commit 09d5e29
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scripts/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' })
Expand Down

0 comments on commit 09d5e29

Please sign in to comment.