diff --git a/.github/workflows/add-badges.yml b/.github/workflows/add-badges.yml new file mode 100644 index 0000000..12722a0 --- /dev/null +++ b/.github/workflows/add-badges.yml @@ -0,0 +1,59 @@ +# This action use https://github.com/wow-actions/add-badges?tab=readme-ov-file to add badges to your README.md file. +name: Add Badges + +on: + # we are using workflow_run to trigger the workflow + # because we want to run this workflow only when the Approve PR and delete branch workflow is completed + # GitHub prevents workflows from running on events that were caused by other workflows to prevent unlimited recursion + # so we do not use the release event + # issue: https://github.com/orgs/community/discussions/25281 + # see: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_run + workflow_run: + # the workflow we want to trigger this workflow (see .github/workflows/automerge.yml) + workflows: [Publish to NPM] + types: [completed] + +jobs: + run: + runs-on: ubuntu-latest + steps: + - uses: wow-actions/add-badges@v1 + env: + repo_url: ${{ github.event.repository.html_url }} + repo_name: ${{ github.event.repository.name }} + repo_owner: ${{ github.event.repository.owner.login }} + with: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + badges: | + [ + { + "badge": "https://img.shields.io/github/license/${{ env.repo_owner }}/${{ env.repo_name }}?style=flat-square", + "alt": "MIT License", + "link": "${{ env.repo_url }}/blob/master/LICENSE" + }, + { + "badge": "https://img.shields.io/npm/v/${{ env.repo_name }}?style=flat-square", + "alt": "NPM Version", + "link": "https://www.npmjs.com/package/${{ env.repo_name }}" + }, + { + "badge": "https://img.shields.io/badge/language-TypeScript-blue.svg?style=flat-square", + "alt": "Language", + "link": "https://www.typescriptlang.org" + }, + { + "badge": "https://img.shields.io/github/contributors/${{ env.repo_owner }}/${{ env.repo_name }}?style=flat-square", + "alt": "Contributors", + "link": "${{ env.repo_url }}/graphs/contributors" + }, + { + "badge": "https://img.shields.io/github/last-commit/${{ env.repo_owner }}/${{ env.repo_name }}?style=flat-square", + "alt": "Last Commit", + "link": "${{ env.repo_url }}/commits/master" + }, + { + "badge": "https://img.shields.io/lgtm/grade/javascript/g/${{ env.repo_owner }}/${{ env.repo_name }}.svg?logo=lgtm&style=flat-square", + "alt": "Language grade: JavaScript", + "link": "https://lgtm.com/projects/g/${{ env.repo_owner }}/${{ env.repo_name }}/context:javascript" + } + ] diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 45bf94d..a9f24a8 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -44,10 +44,12 @@ jobs: - name: Build run: yarn build - + # npm publish - name: Publish package on NPM 📦 # if using yarn v4 run: yarn npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + - run: echo "Published to NPM 🚀- https://www.npmjs.com/package/mui-tiptap-editor" diff --git a/README.md b/README.md index 2c3945b..89703f6 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,11 @@ # mui-tiptap-editor

- mui-tiptap-editor: A customizable and easy to use Tiptap styled WYSIWYG rich text editor, using Material UI. -

- + + ## Table of Contents