Skip to content

Commit 56181f8

Browse files
committed
added circle ci config
1 parent 798123f commit 56181f8

File tree

2 files changed

+184
-92
lines changed

2 files changed

+184
-92
lines changed

.circleci/config.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
version: 2.1
2+
3+
orbs:
4+
node: circleci/[email protected]
5+
python: circleci/[email protected]
6+
aws-cli: circleci/[email protected]
7+
8+
jobs:
9+
test:
10+
docker:
11+
- image: cimg/python:3.10
12+
steps:
13+
- checkout
14+
- python/install-packages:
15+
pkg-manager: pip
16+
args: uv
17+
- run:
18+
name: Install dependencies
19+
command: |
20+
uv sync --group dev
21+
- run:
22+
name: Validate Server JSON Files
23+
command: |
24+
# Install jsonschema if not already installed
25+
pip install jsonschema
26+
# Validate all server JSON files against schema
27+
for file in mcp-registry/servers/*.json; do
28+
echo "Validating $file"
29+
python -c "
30+
import json
31+
import jsonschema
32+
33+
with open('mcp-registry/schema/server-schema.json') as schema_file:
34+
schema = json.load(schema_file)
35+
36+
with open('$file') as data_file:
37+
data = json.load(data_file)
38+
39+
jsonschema.validate(data, schema)
40+
print('✓ Valid')
41+
"
42+
done
43+
- run:
44+
name: Run tests
45+
command: |
46+
source .venv/bin/activate
47+
pytest
48+
- run:
49+
name: Check code style with ruff
50+
command: |
51+
source .venv/bin/activate
52+
ruff check src/ tests/
53+
54+
deploy:
55+
docker:
56+
- image: cimg/python:3.10
57+
steps:
58+
- checkout
59+
- python/install-packages:
60+
pkg-manager: pip
61+
args: uv
62+
- run:
63+
name: Install Python dependencies
64+
command: |
65+
uv sync --group dev
66+
- run:
67+
name: Run preparation script
68+
command: |
69+
chmod +x ./scripts/prepare.sh
70+
source .venv/bin/activate
71+
./scripts/prepare.sh ./output
72+
- aws-cli/setup
73+
- run:
74+
name: Upload servers.json to S3
75+
command: |
76+
aws s3 cp ./output/api/servers.json s3://aitools.eilat.melioservices.com/mcpm/servers.json --content-type "application/json"
77+
- run:
78+
name: Invalidate CloudFront cache
79+
command: |
80+
aws cloudfront create-invalidation --distribution-id E3VSH7IG39WRB6 --paths "/mcpm/servers.json"
81+
82+
workflows:
83+
test-and-deploy:
84+
jobs:
85+
- test
86+
- deploy:
87+
requires:
88+
- test
89+
filters:
90+
branches:
91+
only: adapt-ci
Lines changed: 93 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,93 @@
1-
name: Semantic Release
2-
3-
on:
4-
push:
5-
branches:
6-
- main
7-
8-
permissions:
9-
contents: write
10-
issues: write
11-
pull-requests: write
12-
13-
jobs:
14-
test:
15-
uses: ./.github/workflows/test.yml
16-
17-
release:
18-
name: Release
19-
needs: test
20-
runs-on: ubuntu-latest
21-
environment:
22-
name: melio-s3
23-
url: https://aitools.eilat.melioservices.com/mcpm/servers.json
24-
25-
steps:
26-
- name: Checkout
27-
uses: actions/checkout@v4
28-
with:
29-
fetch-depth: 0
30-
persist-credentials: false
31-
32-
- name: Generate token
33-
id: generate_token
34-
uses: tibdex/github-app-token@v2
35-
with:
36-
app_id: ${{ secrets.BOT_APP_ID }}
37-
private_key: ${{ secrets.BOT_PRIVATE_KEY }}
38-
39-
- name: Install pnpm
40-
uses: pnpm/action-setup@v4
41-
with:
42-
version: 8
43-
run_install: false
44-
45-
- name: Setup Node.js
46-
uses: actions/setup-node@v4
47-
with:
48-
node-version: 'lts/*'
49-
cache: 'pnpm'
50-
51-
- name: Install dependencies
52-
run: pnpm install
53-
54-
- name: Semantic Release
55-
id: semantic
56-
uses: cycjimmy/semantic-release-action@v4
57-
env:
58-
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
59-
60-
- name: Install uv with caching
61-
if: steps.semantic.outputs.new_release_published == 'true'
62-
uses: astral-sh/setup-uv@v5
63-
with:
64-
enable-cache: true
65-
cache-dependency-glob: "pyproject.toml"
66-
67-
- name: Run preparation script
68-
if: steps.semantic.outputs.new_release_published == 'true'
69-
env:
70-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71-
run: |
72-
chmod +x ./scripts/prepare.sh
73-
source .venv/bin/activate
74-
./scripts/prepare.sh ./output
75-
76-
- name: Configure AWS credentials
77-
if: steps.semantic.outputs.new_release_published == 'true'
78-
uses: aws-actions/configure-aws-credentials@v4
79-
with:
80-
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
81-
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
82-
aws-region: us-east-1
83-
84-
- name: Upload servers.json to S3
85-
if: steps.semantic.outputs.new_release_published == 'true'
86-
run: |
87-
aws s3 cp ./output/api/servers.json s3://aitools.eilat.melioservices.com/mcpm/servers.json --content-type "application/json"
88-
89-
- name: Invalidate CloudFront cache
90-
if: steps.semantic.outputs.new_release_published == 'true'
91-
run: |
92-
aws cloudfront create-invalidation --distribution-id E3VSH7IG39WRB6 --paths "/mcpm/servers.json"
1+
# DISABLED: Moved to CircleCI
2+
# name: Semantic Release
3+
#
4+
# on:
5+
# push:
6+
# branches:
7+
# - main
8+
#
9+
# permissions:
10+
# contents: write
11+
# issues: write
12+
# pull-requests: write
13+
#
14+
# jobs:
15+
# test:
16+
# uses: ./.github/workflows/test.yml
17+
#
18+
# release:
19+
# name: Release
20+
# needs: test
21+
# runs-on: ubuntu-latest
22+
# environment:
23+
# name: melio-s3
24+
# url: https://aitools.eilat.melioservices.com/mcpm/servers.json
25+
#
26+
# steps:
27+
# - name: Checkout
28+
# uses: actions/checkout@v4
29+
# with:
30+
# fetch-depth: 0
31+
# persist-credentials: false
32+
#
33+
# - name: Generate token
34+
# id: generate_token
35+
# uses: tibdex/github-app-token@v2
36+
# with:
37+
# app_id: ${{ secrets.BOT_APP_ID }}
38+
# private_key: ${{ secrets.BOT_PRIVATE_KEY }}
39+
#
40+
# - name: Install pnpm
41+
# uses: pnpm/action-setup@v4
42+
# with:
43+
# version: 8
44+
# run_install: false
45+
#
46+
# - name: Setup Node.js
47+
# uses: actions/setup-node@v4
48+
# with:
49+
# node-version: 'lts/*'
50+
# cache: 'pnpm'
51+
#
52+
# - name: Install dependencies
53+
# run: pnpm install
54+
#
55+
# - name: Semantic Release
56+
# id: semantic
57+
# uses: cycjimmy/semantic-release-action@v4
58+
# env:
59+
# GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
60+
#
61+
# - name: Install uv with caching
62+
# if: steps.semantic.outputs.new_release_published == 'true'
63+
# uses: astral-sh/setup-uv@v5
64+
# with:
65+
# enable-cache: true
66+
# cache-dependency-glob: "pyproject.toml"
67+
#
68+
# - name: Run preparation script
69+
# if: steps.semantic.outputs.new_release_published == 'true'
70+
# env:
71+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72+
# run: |
73+
# chmod +x ./scripts/prepare.sh
74+
# source .venv/bin/activate
75+
# ./scripts/prepare.sh ./output
76+
#
77+
# - name: Configure AWS credentials
78+
# if: steps.semantic.outputs.new_release_published == 'true'
79+
# uses: aws-actions/configure-aws-credentials@v4
80+
# with:
81+
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
82+
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
83+
# aws-region: us-east-1
84+
#
85+
# - name: Upload servers.json to S3
86+
# if: steps.semantic.outputs.new_release_published == 'true'
87+
# run: |
88+
# aws s3 cp ./output/api/servers.json s3://aitools.eilat.melioservices.com/mcpm/servers.json --content-type "application/json"
89+
#
90+
# - name: Invalidate CloudFront cache
91+
# if: steps.semantic.outputs.new_release_published == 'true'
92+
# run: |
93+
# aws cloudfront create-invalidation --distribution-id E3VSH7IG39WRB6 --paths "/mcpm/servers.json"

0 commit comments

Comments
 (0)