diff --git a/package.json b/package.json index fdf935cf3..60ff647c7 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "dev": "vite", "build": "npm run typecheck && vite build", "deploy": "npm run build && node scripts/deploy.js", + "release": "node scripts/release.js", "zipdist": "node scripts/zipdist.js", "typecheck": "tsc --noEmit && tsc-strict", "format": "prettier --write './**/*.{js,ts,tsx,vue}'", diff --git a/scripts/release.js b/scripts/release.js new file mode 100644 index 000000000..0358eb218 --- /dev/null +++ b/scripts/release.js @@ -0,0 +1,23 @@ +import { execSync } from 'child_process' +import { readFileSync } from 'fs' + +try { + // 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) +}