From e45c745625bb6e6eb0e0017ad521fe17fed0af81 Mon Sep 17 00:00:00 2001 From: Parth Gohil <138430690+parthpnx@users.noreply.github.com> Date: Fri, 12 Apr 2024 08:45:55 +0530 Subject: [PATCH] feat(ci): Automated changelog creation from conventional commit messages using semantic-release --- .github/workflows/changelog.yaml | 21 ++++++++++++++++++++ .releaserc | 33 ++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 .github/workflows/changelog.yaml create mode 100644 .releaserc diff --git a/.github/workflows/changelog.yaml b/.github/workflows/changelog.yaml new file mode 100644 index 0000000..65d4b34 --- /dev/null +++ b/.github/workflows/changelog.yaml @@ -0,0 +1,21 @@ +name: Release to Production + +on: + release: + types: [published] + +jobs: + semantic-release: + runs-on: ubuntu-latest + outputs: + version: ${{ steps.releaseVersion.outputs.releaseVersion }} + steps: + - uses: actions/checkout@v3 + - uses: cycjimmy/semantic-release-action@v4 + id: semantic + with: + extra_plugins: | + conventional-changelog-conventionalcommits@6.1.0 + @semantic-release/commit-analyzer@10.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.releaserc b/.releaserc new file mode 100644 index 0000000..03326a7 --- /dev/null +++ b/.releaserc @@ -0,0 +1,33 @@ +plugins: [ + ['@semantic-release/commit-analyzer', { + "preset": "conventionalcommits", + "releaseRules": [ + {"type": "static", "release": "patch"}, + {"type": "chore", "release": "patch"}, + {"type": "style", "release": false} + ] + }], + ['@semantic-release/release-notes-generator', { + "preset": "conventionalcommits", + "presetConfig": { + "types": [ + {"type": "feat", "section": "Features"}, + {"type": "fix", "section": "Bug Fixes"}, + {"type": "chore", "hidden": true}, + {"type": "docs", "hidden": true}, + {"type": "style", "hidden": true}, + {"type": "refactor", "hidden": true}, + {"type": "perf", "hidden": true}, + {"type": "test", "hidden": true}, + {"type": "static", "section": "Static Content"}, + ] + }, + }], + ['@semantic-release/github', { + "successComment": false, + "failTitle": false + }] +] +branches: [ + {name: 'main'}, +] \ No newline at end of file