Skip to content
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

Feature/publish ci #86

Merged
merged 9 commits into from
Oct 18, 2024
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
23 changes: 23 additions & 0 deletions .github/workflows/chat-widget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ on:
push:
branches: main
pull_request:
workflow_dispatch:
inputs:
version:
required: true
type: choice
description: Increment ChatWidget NPM version
default: 'patch'
options:
- patch
- minor
- major

jobs:
build:
Expand Down Expand Up @@ -37,3 +48,15 @@ jobs:

- name: E2E - Run automation suite
run: npm run e2e:run

- name: Authenticate with private NPM package
if: ${{ github.event_name == 'workflow_dispatch' }}
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

- name: NPM Publish ChatWidget
if: ${{ github.event_name == 'workflow_dispatch' }}
# `--force-publish` flag keeps versions consistent across our packages. Totally wild name for this kind of a flag :shrug:
run: |
git config --global user.email "[email protected]"
git config --global user.name "RasaHQ ChatWidget"
npx lerna publish ${{ inputs.version }} --yes --force-publish
15 changes: 6 additions & 9 deletions .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ on:
jobs:
build:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: storybook/

steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
Expand All @@ -28,19 +26,18 @@ jobs:
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
with:
node-version-file: '.nvmrc' # Root of the repository.

# TODO: NPM login instead of auth token?
- name: Authenticate with private NPM package
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

- name: Install dependencies
run: npm ci --ignore-scripts

- name: Build packages
run: npm run build

- name: Lint check
run: npm run lint

- name: Build
run: npm run build-storybook
- name: Install and Build Storybook
run: cd storybook/ && npm install && npm run build-storybook

# We upload the artifact and deploy to GitHub Pages only when this workflow is manually triggered.
- name: Upload pages artifact
Expand Down
4 changes: 2 additions & 2 deletions e2e/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "0.1.2"
}
"version": "0.1.0"
}
34 changes: 17 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"lint": "lerna run lint",
"eslint": "eslint packages/ storybook/ --max-warnings 0",
"e2e:install": "cd e2e && npm ci",
"e2e:run": "(npm run dev&) && sleep 3s && cd e2e && npm run cy:run"
"e2e:run": "(npm run dev&) && sleep 3s && cd e2e && npm run cy:run",
"lerna": "lerna"
},
"devDependencies": {
"@types/node": "^20.14.12",
Expand Down
2 changes: 1 addition & 1 deletion packages/react/dist/RasaChatbotWidget.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/react/dist/RasaChatbotWidget.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/react/dist/types/RasaChatbotWidget.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RasaChatbotWidget as RasaChatbotWidgetElement } from "@rasahq/chat-widget-ui/dist/components/rasa-chatbot-widget.js";
import type { EventName, StencilReactComponent } from '@stencil/react-output-target/runtime';
import { RasaChatbotWidget as RasaChatbotWidgetElement } from "@rasahq/chat-widget-ui/dist/components/rasa-chatbot-widget.js";
type RasaChatbotWidgetEvents = {
onChatSessionStarted: EventName<CustomEvent<{
sessionId: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

/* eslint-disable */

import { RasaChatbotWidget as RasaChatbotWidgetElement, defineCustomElement as defineRasaChatbotWidget } from "@rasahq/chat-widget-ui/dist/components/rasa-chatbot-widget.js";
import type { EventName, StencilReactComponent } from '@stencil/react-output-target/runtime';
import { createComponent } from '@stencil/react-output-target/runtime';
import { RasaChatbotWidget as RasaChatbotWidgetElement, defineCustomElement as defineRasaChatbotWidget } from "@rasahq/chat-widget-ui/dist/components/rasa-chatbot-widget.js";
import React from 'react';

type RasaChatbotWidgetEvents = {
Expand Down
3 changes: 0 additions & 3 deletions packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"name": "@rasahq/chat-widget-react",
"version": "0.1.0",
"publishConfig": {
"access": "restricted"
},
"description": "The Rasa Chatbot React Library enables seamless integration of Rasa-powered chatbot into React applications using web components.",
"homepage": "https://github.com/RasaHQ/chat-widget#readme",
"license": "ISC",
Expand Down
3 changes: 0 additions & 3 deletions packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"name": "@rasahq/chat-widget-sdk",
"version": "0.1.0",
"publishConfig": {
"access": "restricted"
},
"description": "The core package provides essential functionality to connect and interact with a Rasa server.",
"homepage": "https://github.com/RasaHQ/chat-widget#readme",
"license": "ISC",
Expand Down
3 changes: 0 additions & 3 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"name": "@rasahq/chat-widget-ui",
"version": "0.1.0",
"publishConfig": {
"access": "restricted"
},
"description": "A lightweight and efficient chatbot widget built with StencilJS, designed for seamless integration and customizable interface.",
"main": "dist/index.cjs.js",
"module": "dist/index.js",
Expand Down
11 changes: 11 additions & 0 deletions storybook/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,16 @@ const config: StorybookConfig = {
docsMode: true,
defaultName: "Documentation",
},
async viteFinal(config) {
const { mergeConfig } = await import('vite');

return mergeConfig(config, {
server: {
fs: {
allow: ['../']
}
}
});
},
};
export default config;
Loading