2023-05-19 10:46:35 +08:00
|
|
|
version: 2.1
|
|
|
|
executors:
|
|
|
|
node-executor:
|
|
|
|
docker:
|
2023-05-21 22:35:48 +08:00
|
|
|
- image: cimg/node:20.2.0
|
2023-05-19 10:46:35 +08:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
executor: node-executor
|
|
|
|
steps:
|
|
|
|
- checkout
|
2023-11-03 13:23:28 +08:00
|
|
|
- run: git submodule sync
|
2024-06-25 14:06:48 +08:00
|
|
|
- run: git submodule update --init --recursive
|
2025-02-21 14:31:11 +08:00
|
|
|
# 创建必要的目录
|
|
|
|
- run: mkdir -p dist
|
2025-02-21 14:18:40 +08:00
|
|
|
# 首先在根目录安装依赖
|
|
|
|
- run: yarn install
|
|
|
|
# 然后进入 gui 目录安装依赖并构建
|
2025-02-13 19:00:13 +08:00
|
|
|
- run: |
|
|
|
|
cd gui
|
2025-02-21 14:18:40 +08:00
|
|
|
yarn install
|
2025-02-13 19:00:13 +08:00
|
|
|
yarn vscode
|
|
|
|
cd ..
|
2023-12-14 10:28:08 +08:00
|
|
|
- persist_to_workspace:
|
|
|
|
root: .
|
|
|
|
paths:
|
|
|
|
- .
|
2023-12-14 10:28:08 +08:00
|
|
|
test:
|
|
|
|
executor: node-executor
|
|
|
|
steps:
|
2023-12-14 10:28:08 +08:00
|
|
|
- attach_workspace:
|
|
|
|
at: .
|
2023-12-14 10:28:08 +08:00
|
|
|
- run:
|
|
|
|
name: Install Python
|
|
|
|
command: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y python3 python3-pip
|
|
|
|
- run:
|
|
|
|
name: update workflows
|
|
|
|
command: |
|
|
|
|
export PYTHONPATH="$PYTHONPATH:$(pwd)/tools/site-packages"
|
|
|
|
mkdir -p ~/.chat/workflows
|
|
|
|
git clone https://github.com/devchat-ai/workflows.git ~/.chat/workflows/sys
|
|
|
|
cd ~/.chat/workflows/sys
|
|
|
|
- run:
|
|
|
|
name: Run workflow tests
|
|
|
|
command: |
|
|
|
|
export PYTHONPATH="$PYTHONPATH:$(pwd)/tools/site-packages"
|
|
|
|
git config --global user.email "tester@merico.dev"
|
|
|
|
git config --global user.name "tester"
|
|
|
|
python3 test/workflows/workflow_test.py
|
2023-12-14 10:28:08 +08:00
|
|
|
- persist_to_workspace:
|
|
|
|
root: .
|
|
|
|
paths:
|
|
|
|
- .
|
2023-05-19 10:46:35 +08:00
|
|
|
publish:
|
|
|
|
executor: node-executor
|
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: .
|
|
|
|
- run:
|
|
|
|
name: "Update version in package.json"
|
|
|
|
command: |
|
|
|
|
sed -i "s/\"version\": \".*\",/\"version\": \"${CIRCLE_TAG:1}\",/" package.json
|
|
|
|
- run:
|
|
|
|
name: "Publish to Marketplace"
|
2023-08-21 11:52:00 +08:00
|
|
|
command: npx vsce publish -p $VSCE_TOKEN --allow-star-activation --pre-release
|
2023-05-19 10:46:35 +08:00
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
build-and-publish:
|
|
|
|
jobs:
|
|
|
|
- build:
|
|
|
|
filters:
|
2023-05-21 22:01:04 +08:00
|
|
|
tags:
|
|
|
|
only: /.*/
|
2023-05-19 10:46:35 +08:00
|
|
|
branches:
|
2023-05-21 22:01:04 +08:00
|
|
|
ignore: []
|
2023-12-14 10:28:08 +08:00
|
|
|
- test:
|
|
|
|
requires:
|
|
|
|
- build
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
|
|
|
branches:
|
2023-12-14 10:28:08 +08:00
|
|
|
ignore: /.*/
|
2023-05-19 10:46:35 +08:00
|
|
|
- publish:
|
|
|
|
requires:
|
|
|
|
- build
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
|
|
|
branches:
|
2025-02-21 14:18:40 +08:00
|
|
|
ignore: /.*/
|