fix/release-workflow-issues #19
@@ -80,8 +80,12 @@ jobs:
|
||||
- name: Commit version bump
|
||||
run: |
|
||||
git add package.json CHANGELOG.md
|
||||
git commit -m "chore: bump version to v${{ steps.version.outputs.new_version }}"
|
||||
git push origin main
|
||||
if git diff --cached --quiet; then
|
||||
echo "No changes to commit (version may already be at target version)"
|
||||
else
|
||||
git commit -m "chore: bump version to v${{ steps.version.outputs.new_version }}"
|
||||
git push origin main
|
||||
fi
|
||||
|
||||
- name: Create git tag for release
|
||||
run: |
|
||||
|
||||
+38
-28
@@ -175,37 +175,47 @@ function main() {
|
||||
console.log(`New version: ${currentVersion} → ${newVersion}`);
|
||||
}
|
||||
|
||||
// Confirm with user
|
||||
const readline = require('readline');
|
||||
const rl = readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout
|
||||
});
|
||||
// Confirm with user (or skip if --yes flag is set)
|
||||
if (skipConfirm) {
|
||||
// Update package.json
|
||||
updatePackageJson(newVersion);
|
||||
|
||||
rl.question(`\nApply version ${newVersion}? (y/N) `, (answer) => {
|
||||
if (answer.toLowerCase() === 'y' || answer.toLowerCase() === 'yes') {
|
||||
// Update package.json
|
||||
updatePackageJson(newVersion);
|
||||
|
||||
// Update changelog
|
||||
if (bumpType !== 'custom') {
|
||||
const commits = getCommitsSinceLastTag();
|
||||
updateChangelog(newVersion, commits, bumpType);
|
||||
}
|
||||
|
||||
console.log(`\n✅ Version bumped to ${newVersion}`);
|
||||
console.log(`\nNext steps:`);
|
||||
console.log(` 1. Review changes: git diff`);
|
||||
console.log(` 2. Commit changes: git commit -am "chore: bump version to v${newVersion}"`);
|
||||
console.log(` 3. Create tag: git tag -a v${newVersion} -m "Release v${newVersion}"`);
|
||||
console.log(` 4. Push changes: git push origin main`);
|
||||
console.log(` 5. Push tag: git push origin v${newVersion}`);
|
||||
} else {
|
||||
console.log('❌ Version bump cancelled');
|
||||
// Update changelog
|
||||
if (bumpType !== 'custom') {
|
||||
const commits = getCommitsSinceLastTag();
|
||||
updateChangelog(newVersion, commits, bumpType);
|
||||
}
|
||||
|
||||
rl.close();
|
||||
});
|
||||
console.log(`\n✅ Version bumped to ${newVersion}`);
|
||||
process.exit(0);
|
||||
} else {
|
||||
const readline = require('readline');
|
||||
const rl = readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout
|
||||
});
|
||||
|
||||
rl.question(`\nApply version ${newVersion}? (y/N) `, (answer) => {
|
||||
if (answer.toLowerCase() === 'y' || answer.toLowerCase() === 'yes') {
|
||||
// Update package.json
|
||||
updatePackageJson(newVersion);
|
||||
|
||||
// Update changelog
|
||||
if (bumpType !== 'custom') {
|
||||
const commits = getCommitsSinceLastTag();
|
||||
updateChangelog(newVersion, commits, bumpType);
|
||||
}
|
||||
|
||||
console.log(`\n✅ Version bumped to ${newVersion}`);
|
||||
process.exit(0);
|
||||
} else {
|
||||
console.log('❌ Version bump cancelled');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
rl.close();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Run main function
|
||||
|
||||
Reference in New Issue
Block a user