UNPKG

payload-cms-mcp

Version:

Payload CMS 3.0 MCP Server - A specialized Model Context Protocol server for Payload CMS

53 lines (44 loc) • 1.49 kB
#!/usr/bin/env node const { execSync } = require('child_process'); const fs = require('fs'); const path = require('path'); // Get package.json const packageJsonPath = path.join(__dirname, '..', 'package.json'); const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8')); const version = packageJson.version; console.log(`\nšŸš€ Preparing release for version ${version}...\n`); // Run tests console.log('šŸ“‹ Running tests...'); try { execSync('npm test', { stdio: 'inherit' }); } catch (error) { console.error('āŒ Tests failed. Aborting release.'); process.exit(1); } // Build (if needed) // console.log('šŸ”Ø Building package...'); // execSync('npm run build', { stdio: 'inherit' }); // Create git tag console.log(`šŸ“Œ Creating git tag v${version}...`); try { execSync(`git tag -a v${version} -m "Release v${version}"`, { stdio: 'inherit' }); } catch (error) { console.log(`āš ļø Tag v${version} already exists or git error occurred.`); } // Push to git console.log('šŸ“¤ Pushing to git...'); try { execSync('git push --follow-tags', { stdio: 'inherit' }); } catch (error) { console.error('āŒ Failed to push to git. Aborting release.'); process.exit(1); } // Publish to npm console.log('šŸ“¦ Publishing to npm...'); try { execSync('npm publish --access public', { stdio: 'inherit' }); } catch (error) { console.error('āŒ Failed to publish to npm.'); process.exit(1); } console.log(`\nāœ… Successfully released version ${version}!\n`);