Skip to content

Commit

Permalink
👷 Add release drafter and changelog workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
rmarting committed Jun 15, 2023
1 parent 7bd9d7c commit eb0b0eb
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This release drafter follows the conventions from https://keepachangelog.com

name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
template: |
## What Changed 👀
$CHANGES
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
categories:
- title: 🚀 Features
labels:
- feature
- enhancement
- title: 🐛 Bug Fixes
labels:
- fix
- bug
- title: ⚠️ Changes
labels:
- changed
- title: ⛔️ Deprecated
labels:
- deprecated
- title: 🗑 Removed
labels:
- removed
- title: 🔐 Security
labels:
- security
- title: 📄 Documentation
labels:
- docs
- documentation
- title: 🧩 Dependency Updates
labels:
- deps
- dependencies
collapse-after: 5

change-template: '* $TITLE (#$NUMBER)' # Default "* $TITLE (#$NUMBER) @$AUTHOR"
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.

exclude-labels:
- skip-changelog
27 changes: 27 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 🔖 Release Drafter 🔖

on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+

permissions:
contents: read

jobs:
update_release_draft:
name: Release drafter
runs-on: ubuntu-latest
permissions:
# write permission is required to create a github release
contents: write

steps:
- name: Update Release Draft
uses: release-drafter/release-drafter@v5
with:
publish: true
prerelease: false
env:
# Instead of GITHUB_TOKEN Ref: https://github.com/stefanzweifel/changelog-updater-action/discussions/30
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
32 changes: 32 additions & 0 deletions .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: 📄 Update Changelog 📄

on:
release:
types: [released]

jobs:
update:
name: Update Changelog
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# updated CHANGELOG back to the repository.
# https://github.blog/changelog/2023-02-02-github-actions-updating-the-default-github_token-permissions-to-read-only/
contents: write

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Update Changelog
uses: stefanzweifel/changelog-updater-action@v1
with:
latest-version: ${{ github.event.release.tag_name }}
release-notes: ${{ github.event.release.body }}

- name: Commit updated Changelog
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: main
commit_message: '🔖 Update changelog'
file_pattern: CHANGELOG.md

0 comments on commit eb0b0eb

Please sign in to comment.