Update README.md #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: 'conventionalcommits' | |
tag-prefix: 'v' | |
output-file: 'CHANGELOG.md' | |
skip-version-file: false | |
skip-commit: 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 }} |