Skip to content

Commit

Permalink
Create Changelog Workflow
Browse files Browse the repository at this point in the history
to generate release notes
  • Loading branch information
puneetbehl committed Feb 23, 2024
1 parent 587436e commit 6cd5505
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name-template: $RESOLVED_VERSION
tag-template: v$RESOLVED_VERSION
categories:
- title: ✨ Features
labels:
- "type: enhancement"
- "type: new feature"
- "type: major"
- title: 🐛 Bug Fixes/Improvements
labels:
- "type: improvement"
- "type: bug"
- "type: minor"
- title: 🛠 Dependency upgrades
labels:
- "type: dependency upgrade"
- "dependencies"
- title: ⚙️ Build/CI
labels:
- "type: ci"
- "type: build"
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
version-resolver:
major:
labels:
- 'type: major'
minor:
labels:
- 'type: minor'
patch:
labels:
- 'type: patch'
default: patch
template: |
## What's Changed
$CHANGES
## Contributors
$CONTRIBUTORS
44 changes: 44 additions & 0 deletions .github/workflows/release-notes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Changelog
on:
issues:
types: [closed,reopened]
push:
branches:
- master
- '[4-9]+.[0-9]+.x'
workflow_dispatch:
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
release_notes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check if it has release drafter config file
id: check_release_drafter
run: |
has_release_drafter=$([ -f .github/release-drafter.yml ] && echo "true" || echo "false")
echo "has_release_drafter=${has_release_drafter}" >> $GITHUB_OUTPUT
- name: Extract branch name
id: extract_branch
run: echo "value=${GITHUB_REF:11}" >> $GITHUB_OUTPUT
# If it has release drafter:
- uses: release-drafter/release-drafter@v5
if: steps.check_release_drafter.outputs.has_release_drafter == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- uses: micronaut-projects/github-actions/release-notes@master
if: steps.check_release_drafter.outputs.has_release_drafter == 'false'
id: release_notes
with:
token: ${{ secrets.GH_TOKEN }}
- uses: ncipollo/release-action@v1
if: steps.check_release_drafter.outputs.has_release_drafter == 'false' && steps.release_notes.outputs.generated_changelog == 'true'
with:
allowUpdates: true
commit: ${{ steps.release_notes.outputs.current_branch }}
draft: true
name: ${{ env.title }} ${{ steps.release_notes.outputs.next_version }}
tag: v${{ steps.release_notes.outputs.next_version }}
bodyFile: CHANGELOG.md
token: ${{ secrets.GH_TOKEN }}

0 comments on commit 6cd5505

Please sign in to comment.