Skip to content

Commit

Permalink
chore: add automatic releases
Browse files Browse the repository at this point in the history
chore: add automatic releases
  • Loading branch information
dbeilin authored Dec 29, 2024
2 parents a682d85 + e5fba72 commit a7c4d30
Show file tree
Hide file tree
Showing 5 changed files with 8,106 additions and 1,696 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: PR Title Check
on:
pull_request:
types: [opened, edited, synchronize, reopened]

jobs:
check-pr-title:
name: Validate PR Title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
feat
fix
docs
style
refactor
perf
test
chore
revert
ci
build
requireScope: false
subjectPattern: ^[a-z].+$
subjectPatternError: |
The subject must start with a lowercase letter and not end with a period.
Examples: 'feat: add user authentication' or 'fix: resolve memory leak'
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release
on:
push:
branches:
- main

permissions:
contents: write
issues: write
pull-requests: write

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
14 changes: 14 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/github",
["@semantic-release/git", {
"assets": ["package.json", "package-lock.json", "CHANGELOG.md"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}]
]
}
Loading

0 comments on commit a7c4d30

Please sign in to comment.