mirror of
https://github.com/hexastack/hexabot
synced 2025-04-10 15:55:55 +00:00
commit
9340a79e72
51
.github/workflows/docker-api.yml
vendored
Normal file
51
.github/workflows/docker-api.yml
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
name: Build and Push Docker API Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: hexastack/hexabot-api
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to Docker Hub
|
||||
if: github.event_name != 'pull_request'
|
||||
id: docker_login
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Build and push API Docker image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: ./api/
|
||||
target: production
|
||||
file: ./api/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
50
.github/workflows/docker-base.yml
vendored
Normal file
50
.github/workflows/docker-base.yml
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
name: Build and Push Docker Base Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: hexastack/hexabot-base
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to Docker Hub
|
||||
if: github.event_name != 'pull_request'
|
||||
id: docker_login
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Build and push Base Docker base image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: ./api/
|
||||
file: ./api/Dockerfile.base
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
50
.github/workflows/docker-nlu.yml
vendored
Normal file
50
.github/workflows/docker-nlu.yml
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
name: Build and Push Docker NLU Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: hexastack/hexabot-nlu
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to Docker Hub
|
||||
if: github.event_name != 'pull_request'
|
||||
id: docker_login
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Build and push NLU Docker image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: ./nlu/
|
||||
file: ./nlu/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
51
.github/workflows/docker-ui.yml
vendored
Normal file
51
.github/workflows/docker-ui.yml
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
name: Build and Push Docker UI Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: hexastack/hexabot-ui
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to Docker Hub
|
||||
if: github.event_name != 'pull_request'
|
||||
id: docker_login
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Build and push Frontend Docker image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: ./
|
||||
target: production
|
||||
file: ./frontend/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
94
.github/workflows/docker.yml
vendored
94
.github/workflows/docker.yml
vendored
@ -1,94 +0,0 @@
|
||||
name: Build and Push Docker Images
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["main"]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
paths-filter:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
frontend: ${{ steps.filter.outputs.frontend }}
|
||||
api: ${{ steps.filter.outputs.api }}
|
||||
widget: ${{ steps.filter.outputs.widget }}
|
||||
nlu: ${{ steps.filter.outputs.nlu }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Filter paths
|
||||
id: filter
|
||||
uses: dorny/paths-filter@v3
|
||||
with:
|
||||
filters: |
|
||||
frontend:
|
||||
- 'frontend/**'
|
||||
api:
|
||||
- 'api/**'
|
||||
widget:
|
||||
- 'widget/**'
|
||||
nlu:
|
||||
- 'nlu/**'
|
||||
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- paths-filter
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to Docker Hub
|
||||
id: docker_login
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Build and push Frontend Docker image
|
||||
if: ${{ needs.paths-filter.outputs.frontend == 'true' }}
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: ./
|
||||
file: ./frontend/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
target: production
|
||||
tags: hexastack/hexabot-ui:latest
|
||||
|
||||
- name: Build and push API Docker image
|
||||
if: ${{ needs.paths-filter.outputs.api == 'true' }}
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: ./api/
|
||||
target: production
|
||||
file: ./api/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: hexastack/hexabot-api:latest
|
||||
|
||||
- name: Build and push Widget Docker image
|
||||
if: ${{ needs.paths-filter.outputs.widget == 'true' }}
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: ./widget/
|
||||
file: ./widget/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
target: production
|
||||
push: true
|
||||
tags: hexastack/hexabot-widget:latest
|
||||
|
||||
- name: Build and push NLU Docker image
|
||||
if: ${{ needs.paths-filter.outputs.nlu == 'true' }}
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: ./nlu/
|
||||
file: ./nlu/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: hexastack/hexabot-nlu:latest
|
58
.github/workflows/hexabot-npm.yml
vendored
Normal file
58
.github/workflows/hexabot-npm.yml
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
name: Publish Hexabot (API Typescript) NPM Package
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
workflow_dispatch: # Allow manual trigger
|
||||
|
||||
jobs:
|
||||
publish-package:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '18' # Ensure it matches your project requirements
|
||||
cache: 'npm'
|
||||
|
||||
- name: Navigate to API Folder
|
||||
run: cd api/
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build the package
|
||||
run: npm run build
|
||||
|
||||
- name: Determine release type
|
||||
id: determine-release
|
||||
run: |
|
||||
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
|
||||
echo "tag=${{ github.ref_name }}" >> $GITHUB_ENV
|
||||
if [[ "${{ github.ref_name }}" =~ ^v[0-9]+\.[0-9]+\.0$ ]]; then
|
||||
echo "release=minor" >> $GITHUB_ENV
|
||||
elif [[ "${{ github.ref_name }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||
echo "release=patch" >> $GITHUB_ENV
|
||||
else
|
||||
echo "release=none" >> $GITHUB_ENV
|
||||
fi
|
||||
else
|
||||
echo "release=none" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Login to npm
|
||||
if: env.release != 'none'
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
registry-url: 'https://registry.npmjs.org/'
|
||||
node-version: '18'
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
- name: Publish to npm
|
||||
if: env.release != 'none'
|
||||
run: npm publish
|
58
.github/workflows/widget-npm.yml
vendored
Normal file
58
.github/workflows/widget-npm.yml
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
name: Publish Hexabot Widget NPM Package
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
workflow_dispatch: # Allow manual trigger
|
||||
|
||||
jobs:
|
||||
publish-package:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '18' # Ensure it matches your project requirements
|
||||
cache: 'npm'
|
||||
|
||||
- name: Navigate to Widget Folder
|
||||
run: cd widget/
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build the package
|
||||
run: npm run build
|
||||
|
||||
- name: Determine release type
|
||||
id: determine-release
|
||||
run: |
|
||||
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
|
||||
echo "tag=${{ github.ref_name }}" >> $GITHUB_ENV
|
||||
if [[ "${{ github.ref_name }}" =~ ^v[0-9]+\.[0-9]+\.0$ ]]; then
|
||||
echo "release=minor" >> $GITHUB_ENV
|
||||
elif [[ "${{ github.ref_name }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||
echo "release=patch" >> $GITHUB_ENV
|
||||
else
|
||||
echo "release=none" >> $GITHUB_ENV
|
||||
fi
|
||||
else
|
||||
echo "release=none" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Login to npm
|
||||
if: env.release != 'none'
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
registry-url: 'https://registry.npmjs.org/'
|
||||
node-version: '18'
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
- name: Publish to npm
|
||||
if: env.release != 'none'
|
||||
run: npm publish
|
@ -39,13 +39,7 @@
|
||||
"typecheck": "tsc --noEmit",
|
||||
"reset": "npm install && npm run containers:restart",
|
||||
"reset:hard": "npm clean-install && npm run containers:rebuild",
|
||||
"migrate": "npx ts-migrate-mongoose --config-path ./migrations/config/migrate.ts",
|
||||
"docker:build-base": "docker build --pull --rm -f Dockerfile.base -t hexabot-base:latest .",
|
||||
"docker:tag-base": "docker tag hexabot-base:latest hexastack/hexabot-base:latest",
|
||||
"docker:push-base": "docker push hexastack/hexabot-base:latest",
|
||||
"docker:release-base": "npm run docker:build-base && npm run docker:tag-base && npm run docker:push-base",
|
||||
"npm:release": "npm version patch && npm publish",
|
||||
"release": "npm run build && npm run npm:release && npm run docker:release-base"
|
||||
"migrate": "npx ts-migrate-mongoose --config-path ./migrations/config/migrate.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs-modules/mailer": "^1.11.2",
|
||||
@ -178,4 +172,4 @@
|
||||
"@/(.*)": "<rootDir>/$1"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
49
bump-version.sh
Executable file
49
bump-version.sh
Executable file
@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Ensure script exits on any command failure
|
||||
set -e
|
||||
|
||||
# Check if a release type argument is provided
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: $0 <release-type>"
|
||||
echo "release-type: patch | minor"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
RELEASE_TYPE=$1
|
||||
ROOT_DIR=$(pwd)
|
||||
|
||||
if [[ "$RELEASE_TYPE" != "patch" && "$RELEASE_TYPE" != "minor" ]]; then
|
||||
echo "Invalid release type. Use 'patch' or 'minor'."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Executing release: $RELEASE_TYPE"
|
||||
|
||||
# Execute the appropriate npm release command
|
||||
if [[ "$RELEASE_TYPE" == "patch" ]]; then
|
||||
npm run release:patch
|
||||
elif [[ "$RELEASE_TYPE" == "minor" ]]; then
|
||||
npm run release:minor
|
||||
fi
|
||||
|
||||
# Retrieve the new version from package.json
|
||||
NEW_VERSION=$(jq -r '.version' "$ROOT_DIR/package.json")
|
||||
|
||||
if [ -z "$NEW_VERSION" ]; then
|
||||
echo "Failed to retrieve the version from package.json."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
# Commit and push changes
|
||||
echo "Committing and pushing changes..."
|
||||
git add .
|
||||
git commit -m "build: v$NEW_VERSION"
|
||||
|
||||
# Add git tag
|
||||
echo "Tagging version v$NEW_VERSION"
|
||||
git tag "v$NEW_VERSION"
|
||||
git push origin main --tags
|
||||
|
||||
echo "Release ($RELEASE_TYPE) completed successfully."
|
@ -11,3 +11,4 @@ LICENSE
|
||||
.next
|
||||
*.swp
|
||||
/scripts
|
||||
*.sh
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "hexabot-ui",
|
||||
"private": true,
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.17",
|
||||
"description": "Hexabot is a solution for creating and managing chatbots across multiple channels, leveraging AI for advanced conversational capabilities. It provides a user-friendly interface for building, training, and deploying chatbots with integrated support for various messaging platforms.",
|
||||
"author": "Hexastack",
|
||||
"license": "AGPL-3.0-only",
|
||||
|
8
package-lock.json
generated
8
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "hexabot",
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.17",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "hexabot",
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.17",
|
||||
"license": "AGPL-3.0-only",
|
||||
"workspaces": [
|
||||
"frontend",
|
||||
@ -45,7 +45,7 @@
|
||||
},
|
||||
"frontend": {
|
||||
"name": "hexabot-ui",
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.18",
|
||||
"license": "AGPL-3.0-only",
|
||||
"dependencies": {
|
||||
"@chatscope/chat-ui-kit-react": "^2.0.3",
|
||||
@ -9771,7 +9771,7 @@
|
||||
},
|
||||
"widget": {
|
||||
"name": "hexabot-chat-widget",
|
||||
"version": "2.0.3",
|
||||
"version": "2.0.18",
|
||||
"license": "AGPL-3.0-only",
|
||||
"dependencies": {
|
||||
"@types/emoji-js": "^3.5.2",
|
||||
|
@ -5,14 +5,18 @@
|
||||
"frontend",
|
||||
"widget"
|
||||
],
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.17",
|
||||
"description": "Hexabot is a solution for creating and managing chatbots across multiple channels, leveraging AI for advanced conversational capabilities. It provides a user-friendly interface for building, training, and deploying chatbots with integrated support for various messaging platforms.",
|
||||
"author": "Hexastack",
|
||||
"license": "AGPL-3.0-only",
|
||||
"scripts": {
|
||||
"prepare": "husky install",
|
||||
"dev:frontend": "npm run dev --workspace=frontend",
|
||||
"dev:widget": "npm run dev --workspace=widget"
|
||||
"dev:widget": "npm run dev --workspace=widget",
|
||||
"release:api:patch": "cd api/ && npm version --git-tag-version false --commit-hooks false patch",
|
||||
"release:api:minor": "cd api/ && npm version --git-tag-version false --commit-hooks false minor",
|
||||
"release:patch": "npm run release:api:patch && npm version --git-tag-version false --commit-hooks false --workspaces patch",
|
||||
"release:minor": "npm run release:api:minor && npm version --git-tag-version false --commit-hooks false --workspaces minor"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^19.3.0",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hexabot-chat-widget",
|
||||
"version": "2.0.3",
|
||||
"version": "2.0.17",
|
||||
"description": "Hexabot is a solution for creating and managing chatbots across multiple channels, leveraging AI for advanced conversational capabilities. It provides a user-friendly interface for building, training, and deploying chatbots with integrated support for various messaging platforms.",
|
||||
"author": "Hexastack",
|
||||
"license": "AGPL-3.0-only",
|
||||
@ -14,8 +14,7 @@
|
||||
"lint:fix": "eslint . --ext ts,tsx --fix",
|
||||
"preview": "vite preview",
|
||||
"serve": "npx http-server ./dist/",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"release": "npm run build && npm version patch && npm publish"
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/emoji-js": "^3.5.2",
|
||||
|
Loading…
Reference in New Issue
Block a user