Skip to content

Commit c393e0b

Browse files
kunwarVivekclaude
andcommitted
feat: add GitHub release creation to publish script
Now creates GitHub release after npm publish using gh CLI. Falls back gracefully with manual URL if gh is not installed. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 7f08007 commit c393e0b

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

scripts/publish.js

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,26 @@ async function runPublish() {
6565

6666
// Create Git tag and push
6767
console.log('📌 Creating git tag and pushing...');
68-
execSync(`git add package.json`);
69-
execSync(`git commit -m "release: version ${newVersion}"`);
68+
execSync(`git add package.json package-lock.json`);
69+
execSync(`git commit -m "release: v${newVersion}"`);
7070
execSync(`git tag v${newVersion}`);
7171
execSync('git push');
7272
execSync('git push --tags');
73-
74-
console.log(`✅ Successfully published version ${newVersion}!`);
73+
74+
// Create GitHub Release
75+
console.log('📋 Creating GitHub release...');
76+
try {
77+
const releaseNotes = `## v${newVersion}\n\nSee [CHANGELOG.md](https://github.com/kunwarVivek/mcp-github-project-manager/blob/main/CHANGELOG.md) for details.\n\n📦 **npm:** \`npm install mcp-github-project-manager@${newVersion}\``;
78+
execSync(`gh release create v${newVersion} --title "v${newVersion}" --notes "${releaseNotes}"`, { stdio: 'inherit' });
79+
console.log('✅ GitHub release created!');
80+
} catch (error) {
81+
console.log('⚠️ GitHub release creation failed (gh CLI may not be installed). Create manually at:');
82+
console.log(` https://github.com/kunwarVivek/mcp-github-project-manager/releases/new?tag=v${newVersion}`);
83+
}
84+
85+
console.log(`\n✅ Successfully published version ${newVersion}!`);
86+
console.log(` npm: https://www.npmjs.com/package/mcp-github-project-manager`);
87+
console.log(` GitHub: https://github.com/kunwarVivek/mcp-github-project-manager/releases/tag/v${newVersion}`);
7588
} catch (error) {
7689
process.stderr.write('❌ Error during publishing:', error.message);
7790
process.exit(1);

0 commit comments

Comments
 (0)