Skip to content

Commit

Permalink
ci: add new github action
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdihadeli committed Aug 22, 2024
1 parent d4273f3 commit 411f98e
Show file tree
Hide file tree
Showing 2 changed files with 150 additions and 0 deletions.
115 changes: 115 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# https://johanneskonings.dev/github/2021/02/28/github_automatic_releases_and-changelog/
# https://tiagomichaelsousa.dev/articles/stop-writing-your-changelogs-manually

# This release drafter follows the conventions
# from https://keepachangelog.com

# https://github.com/release-drafter/release-drafter/issues/551
# https://github.com/release-drafter/release-drafter/pull/1013
# https://github.com/release-drafter/release-drafter/issues/139
# https://github.com/atk4/data/blob/develop/.github/release-drafter.yml
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
- title: ♻️ Enhancement
labels:
- enhancement
- refactor
- title: 🐛 Bug Fixes
labels:
- fix
- bug
- title: 👷 CI
labels:
- ci
- title: ⚠️ Breaking Changes
labels:
- breaking-changes
- title: ⛔️ Deprecated
labels:
- deprecated
- title: 🗑 Removed
labels:
- removed
- title: 🔐 Security
labels:
- security
- title: 📄 Documentation
labels:
- docs
- documentation
- title: 🧩 Dependency Updates
labels:
- deps
- dependencies
- title: 🧰 Maintenance
label: 'chore'
- title: 🧺 Miscellaneous #Everything except ABAP
label: misc
- title: 🚩 Other changes
## putting no labels pr to `Other Changes` category with no label - https://github.com/release-drafter/release-drafter/issues/139#issuecomment-480473934


# https://www.trywilco.com/post/wilco-ci-cd-github-heroku
# https://github.com/release-drafter/release-drafter#autolabeler
# https://github.com/fuxingloh/multi-labeler

# Using regex for defining rules - https://regexr.com/
# https://stackoverflow.com/questions/58899999/regexp-to-match-conventional-commit-syntax
autolabeler:
- label: 'chore'
branch:
- '(chore)(\([a-z ]+\))?\/.'
title:
- '^(chore)(\([a-z ]+\))?: .'
- label: 'bug'
branch:
- '(fix)(\([a-z ]+\))?\/.'
title:
- '^(fix)(\([a-z ]+\))?: .'
- label: 'feature'
branch:
- '(feat)(\([a-z ]+\))?\/.'
title:
- '^(feat)(\([a-z ]+\))?: .'
- label: 'ci/cd'
branch:
- '(ci)(\([a-z ]+\))?\/.'
title:
- '^(ci)(\([a-z ]+\))?: .'
- label: 'minor'
branch:
- '(feat)(\([a-z ]+\))?\/.'
title:
- '^(feat)(\([a-z ]+\))?: .'
- label: 'patch'
branch:
- '(fix)(\([a-z ]+\))?\/.'
- '(ci)(\([a-z ]+\))?\/.'
title:
- '^(fix)(\([a-z ]+\))?: .'
- '^(ci)(\([a-z ]+\))?: .'

change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
version-resolver:
major:
labels:
- breaking-changes
minor:
labels:
- minor
patch:
labels:
- patch
default: patch

exclude-labels:
- skip-changelog
35 changes: 35 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# https://johanneskonings.dev/github/2021/02/28/github_automatic_releases_and-changelog/
# https://tiagomichaelsousa.dev/articles/stop-writing-your-changelogs-manually
name: Release Drafter

on:
push:
tags:
- v*

jobs:
update_release_draft:
name: Release drafter
runs-on: ubuntu-latest

permissions:
# write permission is required to create a github release
contents: write
# write permission is required for autolabeler
# otherwise, read permission is required at least
pull-requests: write

steps:
- name: Update Release Draft
uses: release-drafter/release-drafter@v5
id: semantic
with:
config-name: release-drafter.yml
## Default versioning just increase the path version as default. but the can use minor, patch and breaking-changes labels to apply semver
# version: 1.29.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# - name: Do something when a new release published
# run: |
# echo ${{ $RESOLVED_VERSION steps.semantic.outputs }}

0 comments on commit 411f98e

Please sign in to comment.