Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CD

on:
push:
tags: ["v*"]

jobs:
build-mcpb:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
- run: npm ci
working-directory: mcp-server
- run: npx mcpb pack
working-directory: mcp-server
- uses: actions/upload-artifact@v4
with:
name: mcpb
path: mcp-server/*.mcpb

release:
runs-on: ubuntu-latest
needs: build-mcpb
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: mcpb
path: dist/
- name: Create release with .mcpb
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "${{ github.ref_name }}" dist/*.mcpb \
--title "${{ github.ref_name }}" \
--generate-notes
50 changes: 0 additions & 50 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,53 +16,3 @@ jobs:
python-version: "3.12"
- run: pip install -r requirements.txt
- run: python -m unittest discover -v

build-mcpb:
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
- run: npm ci
working-directory: mcp-server
- run: npx mcpb pack
working-directory: mcp-server
- uses: actions/upload-artifact@v4
with:
name: mcpb
path: mcp-server/*.mcpb

tag-build:
runs-on: ubuntu-latest
needs: [test, build-mcpb]
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create build tag
run: |
DATE=$(date -u +%Y-%m-%d)
N=1
while git ls-remote --tags origin "refs/tags/build-${DATE}.${N}" | grep -q .; do
N=$((N + 1))
done
TAG="build-${DATE}.${N}"
git tag "$TAG"
git push origin "$TAG"
echo "BUILD_TAG=$TAG" >> "$GITHUB_ENV"
- uses: actions/download-artifact@v4
with:
name: mcpb
path: dist/
- name: Upload .mcpb to build tag release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "$BUILD_TAG" dist/*.mcpb \
--title "$BUILD_TAG" \
--notes "Automated build" \
--prerelease
22 changes: 22 additions & 0 deletions docs/0-requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,28 @@ Node.js MCP サーバーは環境変数のみで構成する(CLI 引数なし

Node.js >= 18.0.0 が必要。

## CI/CD

### テスト(CI)

| トリガー | ジョブ | 内容 |
|---------|--------|------|
| PR to main / push to main | test | Python unittest |

### リリース(CD)

| トリガー | ジョブ | 内容 |
|---------|--------|------|
| `v*` タグ push | build-mcpb | `mcpb pack` で .mcpb 生成 |
| `v*` タグ push | release | GitHub Release 作成 + .mcpb 添付 |

リリースフロー:
1. `npm version patch/minor/major` で package.json 更新 + `v*` タグ作成
2. `git push origin main --tags` でタグ push
3. CD が自動実行: .mcpb 生成 → release 作成 → .mcpb 添付

バージョン管理は npm (package.json) が正。manifest.json のバージョンも一致させる。

## Infrastructure

| コンポーネント | 用途 |
Expand Down
Loading