diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..ad08572 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,65 @@ +name: Build and Publish + +on: + push: + branches: + - main + tags: + - 'v*' + pull_request: + branches: + - main + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Run type check + run: npm run typecheck + + - name: Run tests + run: npm test + + - name: Build + run: npm run build + + publish: + needs: test + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/v') + permissions: + contents: read + id-token: write + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' + registry-url: 'https://registry.npmjs.org' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Build + run: npm run build + + - name: Publish to npm + run: npm publish --provenance --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index bdf599e..5fb6c07 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,33 @@ { - "name": "datadome-mcp-server", + "name": "@datadome/datadome-mcp-server", "version": "1.0.0", - "private": true, + "description": "DataDome MCP server for interacting with the DataDome Management API", "type": "module", + "main": "dist/main.js", + "bin": { + "datadome-mcp-server": "dist/main.js" + }, + "files": [ + "dist", + "README.md", + "LICENSE" + ], + "keywords": [ + "datadome", + "mcp", + "model-context-protocol", + "security", + "bot-detection", + "api" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/DataDome/datadome-mcp-server.git" + }, + "bugs": { + "url": "https://github.com/DataDome/datadome-mcp-server/issues" + }, + "homepage": "https://github.com/DataDome/datadome-mcp-server#readme", "engines": { "node": ">=18.18" },