Skip to content

Commit ed452f5

Browse files
committed
ci: configure changelog to include all commit types via custom config
1 parent 2804289 commit ed452f5

File tree

2 files changed

+74
-75
lines changed

2 files changed

+74
-75
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = {
2+
types: [
3+
{ type: 'feat', section: 'Features' },
4+
{ type: 'fix', section: 'Bug Fixes' },
5+
{ type: 'chore', section: 'Maintenance' },
6+
{ type: 'docs', section: 'Documentation' },
7+
{ type: 'style', section: 'Styling' },
8+
{ type: 'refactor', section: 'Code Refactoring' },
9+
{ type: 'perf', section: 'Performance' },
10+
{ type: 'test', section: 'Testing' },
11+
{ type: 'ci', section: 'CI/CD' },
12+
{ type: 'build', section: 'Build System' }
13+
]
14+
};

.github/workflows/publish.yml

Lines changed: 60 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,60 @@
1-
name: Publish Package
2-
3-
on:
4-
push:
5-
branches: [ main ]
6-
workflow_dispatch:
7-
8-
permissions:
9-
contents: write
10-
pull-requests: write
11-
12-
jobs:
13-
publish:
14-
runs-on: ubuntu-latest
15-
steps:
16-
- uses: actions/checkout@v4
17-
with:
18-
fetch-depth: 0
19-
20-
- name: Setup Node.js
21-
uses: actions/setup-node@v4
22-
with:
23-
node-version: '18.x'
24-
registry-url: 'https://registry.npmjs.org'
25-
26-
- name: Install dependencies
27-
run: npm ci
28-
29-
- name: Conventional Changelog Action
30-
id: changelog
31-
uses: TriPSs/conventional-changelog-action@v6
32-
with:
33-
github-token: ${{ secrets.GITHUB_TOKEN }}
34-
git-message: 'chore(release): {version}'
35-
preset: |
36-
{
37-
"name": "custom",
38-
"types": [
39-
{"type": "feat", "section": "Features"},
40-
{"type": "fix", "section": "Bug Fixes"},
41-
{"type": "chore", "section": "Maintenance"},
42-
{"type": "docs", "section": "Documentation"},
43-
{"type": "style", "section": "Styling"},
44-
{"type": "refactor", "section": "Code Refactoring"},
45-
{"type": "perf", "section": "Performance"},
46-
{"type": "test", "section": "Testing"},
47-
{"type": "ci", "section": "CI/CD"},
48-
{"type": "build", "section": "Build System"}
49-
]
50-
}
51-
tag-prefix: 'v'
52-
output-file: 'CHANGELOG.md'
53-
skip-version-file: false
54-
skip-commit: false
55-
skip-on-empty: false
56-
git-user-name: ${{ secrets.CHANGELOG_GIT_NAME }}
57-
git-user-email: ${{ secrets.CHANGELOG_GIT_EMAIL }}
58-
59-
- name: Build
60-
run: npm run build
61-
62-
- name: Create Release
63-
if: steps.changelog.outputs.skipped == 'false'
64-
env:
65-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66-
run: |
67-
gh release create v${{ steps.changelog.outputs.version }} \
68-
--title "Release v${{ steps.changelog.outputs.version }}" \
69-
--notes "${{ steps.changelog.outputs.clean_changelog }}"
70-
71-
- name: Publish to NPM
72-
if: steps.changelog.outputs.skipped == 'false'
73-
run: npm publish
74-
env:
75-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1+
name: Publish Package
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
publish:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: '18.x'
24+
registry-url: 'https://registry.npmjs.org'
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Conventional Changelog Action
30+
id: changelog
31+
uses: TriPSs/conventional-changelog-action@v6
32+
with:
33+
github-token: ${{ secrets.GITHUB_TOKEN }}
34+
git-message: 'chore(release): {version}'
35+
config-file-path: '.github/conventional-changelog.config.js'
36+
tag-prefix: 'v'
37+
output-file: 'CHANGELOG.md'
38+
skip-version-file: false
39+
skip-commit: false
40+
skip-on-empty: false
41+
git-user-name: ${{ secrets.CHANGELOG_GIT_NAME }}
42+
git-user-email: ${{ secrets.CHANGELOG_GIT_EMAIL }}
43+
44+
- name: Build
45+
run: npm run build
46+
47+
- name: Create Release
48+
if: steps.changelog.outputs.skipped == 'false'
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
run: |
52+
gh release create v${{ steps.changelog.outputs.version }} \
53+
--title "Release v${{ steps.changelog.outputs.version }}" \
54+
--notes "${{ steps.changelog.outputs.clean_changelog }}"
55+
56+
- name: Publish to NPM
57+
if: steps.changelog.outputs.skipped == 'false'
58+
run: npm publish
59+
env:
60+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)