Skip to content

chore: add a release process (wip) #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/pr-prefix-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
feat: 'feature'
Feat: 'feature'
fix: 'bug'
Fix: 'bug'
chore: 'chore'
Chore: 'chore'
docs: 'documentation'
Docs: 'documentation'
test: 'test'
Test: 'test'
ci: 'ci'
CI: 'ci'
refactor: 'chore'
Refactor: 'chore'
42 changes: 42 additions & 0 deletions .github/release-drafter-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Configuration for Release Drafter workflow
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"
labels:
- "chore"
- "maintenance"
- "documentation"
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
change-title-escapes: '\<*_&'
# You can add # and @ to disable mentions, and add ` to disable code blocks
version-resolver:
default: patch
major:
labels:
# We don't auto-bump major versions. Needs to be done manually.
minor:
labels:
- "feature"
- "enhancement"
patch:
labels:
- "patch"
- "bugfix"
- "bug"
- "chore"
- "maintenance"
- "documentation"
template: |
## Changes

$CHANGES
24 changes: 24 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Release Drafter

on:
push:
branches:
- main
pull_request:
types: [opened, reopened, synchronize]

jobs:
update_release_draft:
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
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v6
with:
config-name: release-drafter-config.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63 changes: 63 additions & 0 deletions .github/workflows/semantic-pr-title-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: "Semantic PR Title Check"

on:
pull_request_target:
types:
- opened
- reopened
- edited
- synchronize
- ready_for_review

permissions:
pull-requests: read

jobs:
validate_pr_title:
name: Validate PR title
runs-on: ubuntu-24.04
steps:
- uses: amannn/action-semantic-pull-request@v5
if: ${{ github.event.pull_request.draft == false }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# Configure which types are allowed (newline-delimited).
# These are intentionally case-insensitive, allowing title casing or all lowercase.
# See: https://github.com/commitizen/conventional-commit-types/blob/master/index.json
types: |
fix
Fix
feat
Feat
docs
Docs
ci
CI
chore
Chore
build
Build
tests
Tests
refactor
Refactor

- name: Check for "do not merge" in PR title
if: ${{ github.event.pull_request.draft == false }}
uses: actions/github-script@v7
with:
script: |
const title = context.payload.pull_request.title.toLowerCase();
if (title.includes('do not merge') || title.includes('do-not-merge')) {
core.setFailed('PR title contains "do not merge" or "do-not-merge". Please remove this before merging.');
}

jobs:
pr-labeler:
runs-on: ubuntu-latest
steps:
- name: Label the PR
uses: gerrymanoim/pr-prefix-labeler@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading