Skip to content

Commit

Permalink
chore: set up semantic release
Browse files Browse the repository at this point in the history
  • Loading branch information
lsndr committed Apr 15, 2024
1 parent 1fdb25f commit f84811e
Show file tree
Hide file tree
Showing 4 changed files with 8,495 additions and 2,865 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release
on:
push:
branches:
- master
- next
- "*.x"
- "*.x.x"

permissions:
contents: read # for checkout

jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.CI_GITHUB_TOKEN }}
persist-credentials: false
- name: Setup Node.js 14
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install dependencies
run: npm clean-install
- name: Setup LTS Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
47 changes: 47 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "angular",
"releaseRules": [
{ "type": "docs", "release": "patch" },
{ "type": "refactor", "release": "patch" },
{ "type": "perf", "release": "patch" },
{ "type": "revert", "release": "patch" }
]
}
],
[
"@semantic-release/release-notes-generator",
{
"parserOpts": {
"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES", "BREAKING"]
},
"preset": "conventionalcommits",
"presetConfig": {
"types": [
{ "type": "build", "section": "Build System", "hidden": false },
{ "type": "chore", "section": "Build System", "hidden": false },
{ "type": "ci", "section": "Continuous Integration", "hidden": false },
{ "type": "docs", "section": "Documentation", "hidden": false },
{ "type": "feat", "section": "Features", "hidden": false },
{ "type": "fix", "section": "Bug Fixes", "hidden": false },
{ "type": "perf", "section": "Performance Improvements", "hidden": false },
{ "type": "refactor", "section": "Code Refactoring", "hidden": false },
{ "type": "revert", "section": "Reverted Changes", "hidden": false },
{ "type": "style", "section": "Styles", "hidden": false },
{ "type": "test", "section": "Tests", "hidden": false }
]
},
"writerOpts": {
"commitsSort": ["subject", "scope"]
}
}
],
"@semantic-release/github",
"@semantic-release/npm",
"@semantic-release/git"
],
"branches": ["+([0-9])?(.{+([0-9]),x}).x", "main", {"name": "next", "prerelease": true}]
}
Loading

0 comments on commit f84811e

Please sign in to comment.