Skip to content
Open
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
21 changes: 21 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
changelog:
categories:
- title: Breaking Changes
labels:
- breaking-change
- breaking
- title: Features
labels:
- enhancement
- feature
- title: Bug Fixes
labels:
- bug
- fix
- title: Refactor
labels:
- refactor
- refactoring
- title: Other Changes
labels:
- "*"
33 changes: 33 additions & 0 deletions .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: PR Labeler

on:
pull_request:
types: [opened, edited]

jobs:
label:
runs-on: ubuntu-22.04
permissions:
pull-requests: write
steps:
- name: Label PR based on conventional commit title
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
LABEL=""

if echo "$PR_TITLE" | grep -qiE '^(feat|fix|refactor|docs|chore)(\(.+\))?!:'; then
LABEL="breaking-change"
elif echo "$PR_TITLE" | grep -qiE '^feat(\(.+\))?:'; then
LABEL="feature"
elif echo "$PR_TITLE" | grep -qiE '^fix(\(.+\))?:'; then
LABEL="fix"
elif echo "$PR_TITLE" | grep -qiE '^refactor(\(.+\))?:'; then
LABEL="refactor"
fi

if [ -n "$LABEL" ]; then
gh pr edit "$PR_NUMBER" --add-label "$LABEL" --repo "${{ github.repository }}"
fi
15 changes: 13 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Publish Latest
permissions:
contents: read
contents: write

on:
push:
Expand Down Expand Up @@ -38,4 +38,15 @@ jobs:
- run: pnpm publish --no-git-checks --tag latest ./lib --access public
if: "!contains(env.NPM_TAG, 'rc')"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

release:
needs: publish
if: "!contains(github.ref_name, 'rc')"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Create GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create "${{ github.ref_name }}" --generate-notes --title "${{ github.ref_name }}"
Loading