From 16813170f9a349988e39490151c5af7635285329 Mon Sep 17 00:00:00 2001 From: Sebastian Czech Date: Fri, 7 Jul 2023 14:22:38 +0200 Subject: [PATCH] feat(workflow): Add semantic-release configuration file --- .github/workflows/{go_ci.yml => pr_ci.yml} | 4 +- .github/workflows/release_ci.yml | 2 +- .releaserc.json | 44 ++++++++++++++++++++++ 3 files changed, 46 insertions(+), 4 deletions(-) rename .github/workflows/{go_ci.yml => pr_ci.yml} (92%) create mode 100644 .releaserc.json diff --git a/.github/workflows/go_ci.yml b/.github/workflows/pr_ci.yml similarity index 92% rename from .github/workflows/go_ci.yml rename to .github/workflows/pr_ci.yml index b4d712b..88c33ab 100644 --- a/.github/workflows/go_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -2,12 +2,10 @@ # A workflow used to get Go dependencies and test code # END -name: Go CI +name: PR CI on: workflow_dispatch: - push: - branches: [ "main" ] pull_request: types: - opened diff --git a/.github/workflows/release_ci.yml b/.github/workflows/release_ci.yml index 1af8101..e63f8ce 100644 --- a/.github/workflows/release_ci.yml +++ b/.github/workflows/release_ci.yml @@ -7,7 +7,7 @@ on: jobs: release-prereqs: - name: Verify if a release is required + name: verify if a release is required runs-on: ubuntu-latest permissions: contents: write diff --git a/.releaserc.json b/.releaserc.json new file mode 100644 index 0000000..b6a09a2 --- /dev/null +++ b/.releaserc.json @@ -0,0 +1,44 @@ +{ + "branches": [ + "main" + ], + "plugins": [ + [ + "@semantic-release/commit-analyzer", + { + "releaseRules": [ + { + "breaking": true, + "release": "minor" + }, + { + "type": "feat", + "release": "patch" + }, + { + "type": "feat", + "scope": "MAJOR", + "release": "major" + } + ] + } + ], + "@semantic-release/release-notes-generator", + [ + "@semantic-release/git", + { + "assets": [ + "README.md" + ], + "message": "chore(release): ${nextRelease.version}\n\n${nextRelease.notes}" + } + ], + [ + "@semantic-release/github", + { + "successComment": ":tada: This ${issue.pull_request ? 'PR is included' : 'issue has been resolved'} in version ${nextRelease.version} :tada:\n\nThe release is available on [Terraform Registry](https://registry.terraform.io/modules/PaloAltoNetworks/vmseries-modules/aws/latest) and [GitHub release](../releases/tag/v${nextRelease.version})\n\n> Posted by [semantic-release](https://github.com/semantic-release/semantic-release) bot" + } + ] + ], + "preset": "conventionalcommits" +} \ No newline at end of file