92 lines
2.4 KiB
YAML
Raw Normal View History

version: 2.1
executors:
node-executor:
docker:
2023-05-21 22:35:48 +08:00
- image: cimg/node:20.2.0
jobs:
build:
executor: node-executor
steps:
- checkout
2023-11-03 13:23:28 +08:00
- run: git submodule sync
- run: git submodule update --init --recursive
# 创建必要的目录
- run: mkdir -p dist
# 首先在根目录安装依赖
- run: yarn install
# 然后进入 gui 目录安装依赖并构建
2025-02-13 19:00:13 +08:00
- run: |
cd gui
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:
- .
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"
command: npx vsce publish -p $VSCE_TOKEN --allow-star-activation --pre-release
workflows:
version: 2
build-and-publish:
jobs:
- build:
filters:
2023-05-21 22:01:04 +08:00
tags:
only: /.*/
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: /.*/
- publish:
requires:
- build
filters:
tags:
only: /.*/
branches:
ignore: /.*/