Skip to content
Merged
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
14 changes: 14 additions & 0 deletions .github/conventional-changelog.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
types: [
{ type: 'feat', section: 'Features' },
{ type: 'fix', section: 'Bug Fixes' },
{ type: 'chore', section: 'Maintenance' },
{ type: 'docs', section: 'Documentation' },
{ type: 'style', section: 'Styling' },
{ type: 'refactor', section: 'Code Refactoring' },
{ type: 'perf', section: 'Performance' },
{ type: 'test', section: 'Testing' },
{ type: 'ci', section: 'CI/CD' },
{ type: 'build', section: 'Build System' }
]
};
135 changes: 60 additions & 75 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,75 +1,60 @@
name: Publish Package

on:
push:
branches: [ main ]
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm ci

- name: Conventional Changelog Action
id: changelog
uses: TriPSs/conventional-changelog-action@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
git-message: 'chore(release): {version}'
preset: |
{
"name": "custom",
"types": [
{"type": "feat", "section": "Features"},
{"type": "fix", "section": "Bug Fixes"},
{"type": "chore", "section": "Maintenance"},
{"type": "docs", "section": "Documentation"},
{"type": "style", "section": "Styling"},
{"type": "refactor", "section": "Code Refactoring"},
{"type": "perf", "section": "Performance"},
{"type": "test", "section": "Testing"},
{"type": "ci", "section": "CI/CD"},
{"type": "build", "section": "Build System"}
]
}
tag-prefix: 'v'
output-file: 'CHANGELOG.md'
skip-version-file: false
skip-commit: false
skip-on-empty: false
git-user-name: ${{ secrets.CHANGELOG_GIT_NAME }}
git-user-email: ${{ secrets.CHANGELOG_GIT_EMAIL }}

- name: Build
run: npm run build

- name: Create Release
if: steps.changelog.outputs.skipped == 'false'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create v${{ steps.changelog.outputs.version }} \
--title "Release v${{ steps.changelog.outputs.version }}" \
--notes "${{ steps.changelog.outputs.clean_changelog }}"

- name: Publish to NPM
if: steps.changelog.outputs.skipped == 'false'
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
name: Publish Package

on:
push:
branches: [ main ]
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm ci

- name: Conventional Changelog Action
id: changelog
uses: TriPSs/conventional-changelog-action@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
git-message: 'chore(release): {version}'
config-file-path: '.github/conventional-changelog.config.js'
tag-prefix: 'v'
output-file: 'CHANGELOG.md'
skip-version-file: false
skip-commit: false
skip-on-empty: false
git-user-name: ${{ secrets.CHANGELOG_GIT_NAME }}
git-user-email: ${{ secrets.CHANGELOG_GIT_EMAIL }}

- name: Build
run: npm run build

- name: Create Release
if: steps.changelog.outputs.skipped == 'false'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create v${{ steps.changelog.outputs.version }} \
--title "Release v${{ steps.changelog.outputs.version }}" \
--notes "${{ steps.changelog.outputs.clean_changelog }}"

- name: Publish to NPM
if: steps.changelog.outputs.skipped == 'false'
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}