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
47 changes: 0 additions & 47 deletions .github/workflows/build-api.yml

This file was deleted.

104 changes: 104 additions & 0 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: Publish to npm

on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
version:
description: 'Version to publish (e.g., 1.0.0)'
required: true
default: '1.0.0'

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'
scope: '@drupaltools'

- name: Install dependencies
run: |
cd mcp-package
npm install

- name: Build the package
run: |
cd mcp-package
npm run build

- name: Run tests
run: |
cd mcp-package
npm test

- name: Determine version
id: version
run: |
if [[ "${{ github.ref_type }}" == "tag" ]]; then
VERSION=${{ github.ref_name }}
VERSION=${VERSION#v} # Remove 'v' prefix if present
else
VERSION=${{ github.event.inputs.version }}
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Publishing version: $VERSION"

- name: Update package version
run: |
cd mcp-package
npm version ${{ steps.version.outputs.version }} --no-git-tag-version
cd dist
npm version ${{ steps.version.outputs.version }} --no-git-tag-version

- name: Publish to npm
run: |
cd mcp-package/dist
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Create GitHub Release
if: github.ref_type == 'tag'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
draft: false
prerelease: false
body: |
## Changes in ${{ github.ref_name }}

This release updates the @drupaltools/mcp npm package with the latest Drupal tools data.

### Installation
```bash
npx @drupaltools/mcp@${{ steps.version.outputs.version }}
```

### Claude Desktop Configuration
```json
{
"mcpServers": {
"drupaltools": {
"type": "stdio",
"command": "npx",
"args": ["@drupaltools/mcp@${{ steps.version.outputs.version }}"]
}
}
}
```
85 changes: 85 additions & 0 deletions .github/workflows/update-mcp-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Update MCP Package

on:
push:
branches: [ main, master ]
paths:
- '_data/projects/*.yml'
pull_request:
branches: [ main, master ]
paths:
- '_data/projects/*.yml'
workflow_dispatch:

jobs:
update-package:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'

- name: Install dependencies
run: |
cd mcp-package
npm install

- name: Build the MCP package with latest data
run: |
cd mcp-package
npm run build

- name: Run tests
run: |
cd mcp-package
npm test

- name: Check for changes
id: changes
run: |
if [[ -n $(git status --porcelain mcp-package/) ]]; then
echo "has_changes=true" >> $GITHUB_OUTPUT
echo "✅ MCP package data updated"
else
echo "has_changes=false" >> $GITHUB_OUTPUT
echo "ℹ️ No changes to MCP package"
fi

- name: Commit and push changes
if: steps.changes.outputs.has_changes == 'true'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add mcp-package/
git commit -m "chore: Update MCP package with latest Drupal tools data

- Rebuilt projects.json with $(cd mcp-package && node -e "console.log(Object.keys(JSON.parse(require('fs').readFileSync('dist/projects.json', 'utf8'))).length)" tools
- Updated package when _data/projects changed

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>"
git push

- name: Create summary
run: |
echo "## MCP Package Update Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [[ "${{ steps.changes.outputs.has_changes }}" == "true" ]]; then
echo "✅ MCP package has been updated with the latest tools data" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "The package will include:" >> $GITHUB_STEP_SUMMARY
echo "- Updated projects.json" >> $GITHUB_STEP_SUMMARY
echo "- All 186+ Drupal tools data" >> $GITHUB_STEP_SUMMARY
else
echo "ℹ️ No changes needed - MCP package is already up to date" >> $GITHUB_STEP_SUMMARY
fi
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ node_modules/
package-lock.json

# Generated files (these are built, not edited)
# Note: api/data/ is committed as it's needed for GitHub Pages
drupaltools.log
*.log
.DS_Store
107 changes: 0 additions & 107 deletions AUTOMATION.md

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2017 TheodorosPloumis
Copyright 2017 - 2025 TheodorosPloumis

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
Loading