From 4ab2e2bd7a5f29730f64539db09c543c421e4ed8 Mon Sep 17 00:00:00 2001 From: Sekwah Date: Fri, 14 May 2021 02:06:23 +0100 Subject: [PATCH] ci: Update changelog scripts --- build.gradle | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 5d9ad72..8599f94 100644 --- a/build.gradle +++ b/build.gradle @@ -241,10 +241,36 @@ task runJar() { } } -task updateChangelog(type: Exec) { - commandLine 'cmd', '/c', 'npx standard-version' - ext.output = { - return standardOutput.toString() +/** + * These are needed as standard-version doesnt allow for the ability to skip tag versions for the changelog. + * Well it does but not on purpose and it breaks things. + */ +task updateChangelog { + doLast{ + exec { + commandLine 'cmd', '/c', 'npx standard-version -t (v)[0-9]+.[0-0]+.[0-0]+(?!-) --skip.tag --skip.bump --skip.commit' + ext.output = { + return standardOutput.toString() + } + } + exec { + commandLine 'cmd', '/c', 'git add CHANGELOG.md' + ext.output = { + return standardOutput.toString() + } + } + exec { + commandLine 'cmd', '/c', 'git commit -m "chore(changelog): Update CHANGELOG.md with full release notes.' + ext.output = { + return standardOutput.toString() + } + } + exec { + commandLine 'cmd', '/c', 'npx standard-version --skip.changelog' + ext.output = { + return standardOutput.toString() + } + } } }