From 0f2fdc4f866038ec42910dd85cf124b102229d43 Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Wed, 26 Mar 2025 14:47:25 +0100 Subject: [PATCH] feat: add ready release go --- .woodpecker.star | 84 ++++++----------------------------------------- release-config.ts | 49 +++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 74 deletions(-) create mode 100644 release-config.ts diff --git a/.woodpecker.star b/.woodpecker.star index 0c132cdc09..0d99cd384a 100644 --- a/.woodpecker.star +++ b/.woodpecker.star @@ -44,6 +44,7 @@ PLUGINS_S3_CACHE = "plugins/s3-cache:1" PLUGINS_SLACK = "plugins/slack:1" REDIS = "redis:6-alpine" SONARSOURCE_SONAR_SCANNER_CLI = "sonarsource/sonar-scanner-cli:11.0" +READY_RELEASE_GO = "woodpeckerci/plugin-ready-release-go:latest" DEFAULT_PHP_VERSION = "8.2" DEFAULT_NODEJS_VERSION = "20" @@ -418,7 +419,7 @@ def main(ctx): pipelines = [] build_release_helpers = \ - changelog() + \ + readyReleaseGo() + \ docs() build_release_helpers.append( @@ -1694,19 +1695,6 @@ def binaryRelease(ctx, arch, depends_on = []): }, ], }, - { - "name": "changelog", - "image": OC_CI_GOLANG, - "environment": CI_HTTP_PROXY_ENV, - "commands": [ - "make changelog CHANGELOG_VERSION=%s" % ctx.build.ref.replace("refs/tags/v", ""), - ], - "when": [ - { - "event": "tag", - }, - ], - }, { "name": "release", "image": PLUGINS_GITHUB_RELEASE, @@ -1718,7 +1706,6 @@ def binaryRelease(ctx, arch, depends_on = []): "opencloud/dist/release/*", ], "title": ctx.build.ref.replace("refs/tags/v", ""), - "note": "opencloud/dist/CHANGELOG.md", "overwrite": True, "prerelease": len(ctx.build.ref.split("-")) > 1, }, @@ -1788,19 +1775,6 @@ def licenseCheck(ctx): "cd third-party-licenses && tar -czf ../third-party-licenses.tar.gz *", ], }, - { - "name": "changelog", - "image": OC_CI_GOLANG, - "environment": CI_HTTP_PROXY_ENV, - "commands": [ - "make changelog CHANGELOG_VERSION=%s" % ctx.build.ref.replace("refs/tags/v", "").split("-")[0], - ], - "when": [ - { - "event": "tag", - }, - ], - }, { "name": "release", "image": PLUGINS_GITHUB_RELEASE, @@ -1812,7 +1786,6 @@ def licenseCheck(ctx): "third-party-licenses.tar.gz", ], "title": ctx.build.ref.replace("refs/tags/v", ""), - "note": "opencloud/dist/CHANGELOG.md", "overwrite": True, "prerelease": len(ctx.build.ref.split("-")) > 1, }, @@ -1838,53 +1811,20 @@ def licenseCheck(ctx): "workspace": workspace, } -def changelog(): +def readyReleaseGo(): return [{ - "name": "changelog", + "name": "ready-release-go", "steps": [ { - "name": "generate", - "image": OC_CI_GOLANG, - "environment": CI_HTTP_PROXY_ENV, - "commands": [ - "make -C opencloud changelog", - ], - }, - { - "name": "diff", - "image": OC_CI_ALPINE, - "commands": [ - "git diff", - ], - }, - { - "name": "output", - "image": OC_CI_ALPINE, - "commands": [ - "cat CHANGELOG.md", - ], - }, - { - "name": "publish", - "image": PLUGINS_GIT_PUSH, + "name": "release-helper", + "image": READY_RELEASE_GO, "settings": { - "branch": "main", - "remote": "ssh://git@github.com/%s.git" % repo_slug, - "commit": True, - "ssh_key": { - "from_secret": "ssh_key", + "git_email": "devops@opencloud.eu", + "forge_type": "github", + "forge_token": { + "from_secret": "github_token", }, - "commit_message": "Automated changelog update [skip ci]", - "author_email": "devops@opencloud.eu", - "author_name": "openclouders", - "rebase": True, }, - "when": [ - { - "event": ["push", "manual"], - "branch": "main", - }, - ], }, ], "when": [ @@ -1892,9 +1832,6 @@ def changelog(): "event": ["push", "manual"], "branch": "main", }, - { - "event": "pull_request", - }, ], }] @@ -2253,7 +2190,6 @@ def skipIfUnchanged(ctx, type): base = [ ".github/**", ".vscode/**", - "changelog/**", "docs/**", "deployments/**", "CHANGELOG.md", diff --git a/release-config.ts b/release-config.ts new file mode 100644 index 0000000000..bc45a1dd1f --- /dev/null +++ b/release-config.ts @@ -0,0 +1,49 @@ +export default { + changeTypes: [ + { + title: '💥 Breaking changes', + labels: ['breaking', 'Type:Breaking-Change'], + bump: 'major', + weight: 3 + }, + { + title: '🔒 Security', + labels: ['security', 'Type:Security'], + bump: 'patch', + weight: 2 + }, + { + title: '✨ Features', + labels: ['feature', 'Type:Feature'], + bump: 'minor', + weight: 1 + }, + { + title: '📈 Enhancement', + labels: ['enhancement', 'refactor', 'Type:Enhancement'], + bump: 'minor' + }, + { + title: '🐛 Bug Fixes', + labels: ['bug', 'Type:Bug'], + bump: 'patch' + }, + { + title: '📚 Documentation', + labels: ['docs', 'documentation', 'Type:Documentation'], + bump: 'patch' + }, + { + title: '✅ Tests', + labels: ['test', 'tests', 'Type:Test'], + bump: 'patch' + }, + { + title: '📦️ Dependencies', + labels: ['dependency', 'dependencies', 'Type:Dependencies'], + bump: 'patch', + weight: -1 + } + ], + useVersionPrefixV: true, +}