Skip to content

Commit e645b60

Browse files
committed
ci(release): Add semantic-release
1 parent c64947b commit e645b60

File tree

3 files changed

+80
-0
lines changed

3 files changed

+80
-0
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@
1010
/phpcs.xml export-ignore
1111
/phpmd.xml export-ignore
1212
/phpstan.neon export-ignore
13+
/.releaserc.json export-ignore
14+
/.cspell.json export-ignore

.github/workflows/release.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
release:
10+
name: Semantic Release
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
issues: write
15+
pull-requests: write
16+
id-token: write
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v3
20+
with:
21+
fetch-depth: 0
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v3
24+
with:
25+
node-version: "lts/*"
26+
- name: Dependencies
27+
run: npm i --no-save semantic-release @commitlint/config-conventional @semantic-release/changelog @semantic-release/git @semantic-release/exec @semantic-release/github
28+
- name: Release
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
run: npx semantic-release

.releaserc.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"branches": ["master"],
3+
"tagFormat": "${version}",
4+
"plugins": [
5+
"@semantic-release/commit-analyzer",
6+
"@semantic-release/release-notes-generator",
7+
[
8+
"@semantic-release/github",
9+
{
10+
"assets": []
11+
}
12+
]
13+
],
14+
"message": "chore(release): ${nextRelease.version}",
15+
"preset": "conventionalcommits",
16+
"presetConfig": {
17+
"types": [
18+
{ "type": "feat", "section": "Features" },
19+
{ "type": "fix", "section": "Bug Fixes" },
20+
{ "type": "perf", "section": "Performance Improvements" },
21+
{ "type": "revert", "section": "Reverts" },
22+
{ "type": "build", "section": "Build System" },
23+
{ "type": "initial", "section": "Initial" },
24+
{ "type": "dependencies", "section": "Dependencies" },
25+
{ "type": "docs", "section": "Documentation", "hidden": true },
26+
{ "type": "style", "section": "Styles" },
27+
{ "type": "chore", "section": "Miscellaneous Chores", "hidden": true },
28+
{ "type": "refactor", "section": "Code Refactoring", "hidden": true },
29+
{ "type": "test", "section": "Tests", "hidden": true },
30+
{ "type": "ci", "section": "Continuous Integration", "hidden": true },
31+
{ "type": "hotfix", "section": "Bug Fixes" }
32+
]
33+
},
34+
"releaseRules": [
35+
{ "breaking": true, "release": "major" },
36+
{ "type": "feat", "release": "minor" },
37+
{ "type": "fix", "release": "patch" },
38+
{ "type": "perf", "release": "patch" },
39+
{ "type": "build", "release": "patch" },
40+
{ "type": "docs", "scope": "readme", "release": "patch" },
41+
{ "type": "initial", "release": "minor" },
42+
{ "type": "dependencies", "release": "patch" },
43+
{ "type": "peerDependencies", "release": "patch" },
44+
{ "type": "metadata", "release": "patch" },
45+
{ "type": "hotfix", "release": "patch" }
46+
]
47+
}

0 commit comments

Comments
 (0)