Skip to content

Commit

Permalink
Merge pull request #56 from netgroup/add-release-drafter-action
Browse files Browse the repository at this point in the history
Setup Release Drafter github action to automate the creation of release drafts
  • Loading branch information
cscarpitta committed Jun 23, 2020
2 parents 703dd53 + 6cdbfe9 commit dbc3839
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 1 deletion.
28 changes: 28 additions & 0 deletions .github/label-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
- regExp: ".*\\.ts+$"
labels: ["typescript"]
- regExp: ".*\\.sql+$"
labels: ["database", "critical"]
- regExp: "^docs/"
labels: ["documentation"]
- regExp: ".*\\.png+$"
labels: ["images"]
- regExp: "^(pom\\.xml|package\\.json|build\\.gradle)$"
labels: ["dependencies"]
- regExp: ".*/requirements.txt"
labels: ["dependencies"]
- regExp: ".*\\.(zip|jar|war|ear)+$"
labels: ["artifact", "invalid"]
- regExp: "^db_update/"
labels: ["database utilities"]
- regExp: "^control_plane/node-manager/"
labels: ["node manager"]
- regExp: "^control_plane/controller/"
labels: ["controller"]
- regExp: "^control_plane/examples/"
labels: ["examples"]
- regExp: "^control_plane/protos/"
labels: ["protos"]
- regExp: ".*/setup.py"
labels: ["build"]
- regExp: "^.github/"
labels: ["github-workflow"]
3 changes: 3 additions & 0 deletions .github/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
feature: ['feature/*', 'feat/*', 'feature-*', 'feat-*']
bug: ['fix/*', 'fix-*']
chore: ['chore/*', 'chore-*']
37 changes: 37 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name-template: 'v$RESOLVED_VERSION 🌈'
tag-template: 'v$RESOLVED_VERSION'
categories:
- title: '🚀 Features'
labels:
- 'feature'
- 'enhancement'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: '🧰 Maintenance'
label: 'chore'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
- 'feature'
- 'enhancement'
patch:
labels:
- 'patch'
- 'fix'
- 'bugfix'
- 'bug'
default: patch
exclude-labels:
- 'skip-changelog'
template: |
## Changes
$CHANGES
2 changes: 1 addition & 1 deletion .github/workflows/autopep8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
committer: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
title: Fixes by autopep8 action
body: This is an auto-generated PR with fixes by autopep8.
labels: autopep8, automated pr
labels: autopep8, automated pr, skip-changelog
reviewers: cscarpitta
branch: ${{ steps.vars.outputs.branch-name }}
- name: Fail if autopep8 made changes
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/pr_labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Workflow to associate labels automatically
name: labeler

# Trigger the workflow on pull request events
on: [pull_request]

jobs:
label:
runs-on: ubuntu-latest
steps:
# We need to checkout the repository to access the configured file (.github/label-pr.yml)
- uses: actions/checkout@v2
- name: Labeler
uses: docker://decathlon/pull-request-labeler-action:2.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Here we can override the path for the action configuration. If none is provided, default one is `.github/label-pr.yml`
# CONFIG_PATH: ${{ secrets.GITHUB_WORKSPACE }}/.github/label-pr.yml

pr-labeler:
runs-on: ubuntu-latest
steps:
- uses: TimonVS/pr-labeler-action@v3
# with:
# configuration-path: .github/pr-labeler.yml # optional, .github/pr-labeler.yml is the default value
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19 changes: 19 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Release Drafter

on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- master

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5
# with:
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
# config-name: my-config.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit dbc3839

Please sign in to comment.