mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-20 23:04:06 +00:00
[CI] Use gh action to bump version (#2810)
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
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' })
|
||||
|
||||
// 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)
|
||||
}
|
||||
Reference in New Issue
Block a user