runRelease method
Implementation
Future<void> runRelease(
String bumpType, {
bool noCommit = false,
bool noTag = false,
bool push = false,
bool noChangelog = false,
}) async {
if (!_isValidBumpType(bumpType)) {
throw ArgumentError('Invalid bump type: $bumpType');
}
final nextVersion = await _calculateNextVersion(bumpType);
await executor.updateVersion(nextVersion);
// Tag only if commit is created
final canTag = !noCommit && !noTag;
if (!noCommit) {
if (!noChangelog) {
final changelog =
await ChangelogGenerator(executor, now: _now).generate(nextVersion);
await _appendToChangelog(changelog);
}
await executor.commit('chore: release $nextVersion');
} else if (!noTag) {
executor.getLogger.warn('[WARNING] Cannot generate changelog because commit was skipped.');
executor.getLogger.warn('[WARNING] Cannot create tag because commit was skipped.');
}
if (canTag) {
await executor.createTag('v$nextVersion');
}
if (!noCommit) {
if (push) await executor.push();
} else if (push) {
executor.getLogger.warn('[WARNING] Cannot push because commit was skipped.');
}
}