Skip to content
Merged
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
60 changes: 60 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Publish CodeX UI to NPM

on:
push:
branches:
- main
paths:
- '@codexteam/ui/**'

jobs:
publish-ui:
name: Publish @codexteam/ui package
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Node.js from .nvmrc
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'

- name: Install dependencies
working-directory: '@codexteam/ui'
run: yarn install

- name: Build package
working-directory: '@codexteam/ui'
run: yarn build

- name: Publish package to npm
working-directory: '@codexteam/ui'
run: yarn publish --access=public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

notify:
name: Notify in CodexBot
needs: publish-ui
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Get UI package info
id: ui-package
uses: codex-team/action-nodejs-package-info@v1
with:
package_json_path: '@codexteam/ui/package.json'

- name: Send a message
uses: codex-team/action-codexbot-notify@v1
with:
webhook: ${{ secrets.CODEX_BOT_WEBHOOK_HAWK }}
message: |
[${{ steps.ui-package.outputs.name }}](${{ steps.ui-package.outputs.npmjs-link }}) v${{ steps.ui-package.outputs.version }} was published
parse_mode: markdown
disable_web_page_preview: true
Loading