2025-02-13 19:00:13 +08:00

91 lines
2.3 KiB
YAML

version: 2.1
executors:
node-executor:
docker:
- image: cimg/node:20.2.0
jobs:
build:
executor: node-executor
steps:
- checkout
- run: git submodule sync
- run: git submodule update --init --recursive
- run: npm install
- run: |
cd gui
yarn
yarn vscode
cd ..
- run: npm run build
- run: yarn package
- persist_to_workspace:
root: .
paths:
- .
test:
executor: node-executor
steps:
- attach_workspace:
at: .
- 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
- 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:
tags:
only: /.*/
branches:
ignore: []
- test:
requires:
- build
filters:
tags:
only: /.*/
branches:
ignore: /.*/
- publish:
requires:
- build
filters:
tags:
only: /.*/
branches:
ignore: /.*/