Skip to content

ci(codex-ui): add CI pipeline for npm publish #322

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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