feat(release): automate versioned releases on main
This commit is contained in:
21
scripts/release/cli.mjs
Normal file
21
scripts/release/cli.mjs
Normal file
@@ -0,0 +1,21 @@
|
||||
import { assertBootstrap, checkCommits, commitsSince, createPlan, readConfig } from './lib.mjs';
|
||||
|
||||
try {
|
||||
const command = process.argv[2];
|
||||
if (command === 'check') {
|
||||
const config = readConfig();
|
||||
assertBootstrap(config, 'HEAD', process.cwd());
|
||||
const commits = commitsSince(config.bootstrapCommit);
|
||||
checkCommits(commits);
|
||||
console.log(`${commits.length} Commit-Nachrichten geprüft.`);
|
||||
} else if (command === 'preview') {
|
||||
const plan = await createPlan();
|
||||
console.log(JSON.stringify(plan, null, 2));
|
||||
console.log('\nLokale Vorschau; berücksichtigt die lokal vorhandenen Tags. Zum Aktualisieren: git fetch origin --tags.');
|
||||
} else {
|
||||
throw new Error('Aufruf: node scripts/release/cli.mjs check|preview');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error.message);
|
||||
process.exitCode = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user