Files
ComfyUI_frontend/scripts/release.js
Chenlei Hu 30642850cb 0.8.16 (#263)
* Checkout new branch on release script run

* 0.8.16

* nit
2024-11-03 16:26:07 -05:00

29 lines
997 B
JavaScript

import { execSync } from 'child_process'
import { readFileSync } from 'fs'
try {
// Create a new branch with version-bump prefix
console.log('Creating new branch...')
const branchName = `version-bump-${new Date().toISOString().split('T')[0]}`
execSync(`git checkout -b ${branchName} -t origin/master`, { stdio: 'inherit' })
// Run npm version patch and capture the output
console.log('Bumping version...')
execSync('npm version patch', { stdio: 'inherit' })
// Read the new version from package.json
const packageJson = JSON.parse(readFileSync('./package.json', 'utf8'))
const newVersion = packageJson.version
// Create the PR
console.log('Creating PR...')
execSync(
`gh pr create --title "${newVersion}" --label "Release" --body "Automated version bump to ${newVersion}"`,
{ stdio: 'inherit' }
)
console.log(`✅ Successfully created PR for version ${newVersion}`)
} catch (error) {
console.error('❌ Error during release process:', error.message)
}