From 2b6ec55cdd8a724c718dbe1494a1d88c9fde0237 Mon Sep 17 00:00:00 2001 From: Katsuhiro Ueno Date: Sat, 20 Jul 2024 16:11:22 +0900 Subject: [PATCH] create an additional commit for major version update --- release/index.js | 17 ++++++++++++++++- release/update-dependencies.js | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/release/index.js b/release/index.js index 46860dc..eca88a5 100644 --- a/release/index.js +++ b/release/index.js @@ -34,7 +34,10 @@ for (const pkg of packages) { hookPlugin(commitAnalyzer, pkg), hookPlugin(notesGenerator, pkg), hookPlugin(npm, { ...pkg, name: null }), - [hookPlugin(updateDependencies, pkg), { ...pkg, packageJsonList }], + [ + hookPlugin(updateDependencies, pkg), + { ...pkg, packageJsonList, major: false } + ], [ hookPlugin(git, { ...pkg, cwd: rootDir, name: null }), { @@ -44,6 +47,18 @@ for (const pkg of packages) { nextRelease.notes %>` } ], + [ + hookPlugin(updateDependencies, pkg), + { ...pkg, packageJsonList, major: true } + ], + [ + hookPlugin(git, { ...pkg, cwd: rootDir, name: null }), + { + assets: packageJsonList, + message: `fix: update ${pkg.name} to version <%= + nextRelease.version %>\n\n[skip ci]` + } + ], hookPlugin(github, pkg) ] } diff --git a/release/update-dependencies.js b/release/update-dependencies.js index 80d5a9d..72103e7 100644 --- a/release/update-dependencies.js +++ b/release/update-dependencies.js @@ -6,6 +6,7 @@ export const prepare = (pluginConfig, { nextRelease }) => { // nothing to do if this is a prerelease. if (nextRelease.channel != null) return if (nextRelease.type.startsWith('pre')) return + if ((nextRelease.type === 'major') !== (pluginConfig.major === true)) return const packageJsonList = pluginConfig.packageJsonList const packageName = pluginConfig.json.name