Skip to main content
Glama
publish-npm.yml4.84 kB
name: Publish to npm on: release: types: [published] workflow_dispatch: inputs: version_bump: description: 'Version bump type (or "none" to use current version)' required: true default: 'patch' type: choice options: - none - patch - minor - major env: NODE_VERSION: '20.x' jobs: publish: name: Build and Publish to npm runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 with: token: ${{ secrets.GH_PAT }} - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: ${{ env.NODE_VERSION }} registry-url: 'https://registry.npmjs.org' - name: Install dependencies run: npm ci - name: Run linting run: npm run lint - name: Run type check run: npm run typecheck - name: Run tests run: npm test - name: Determine version id: version run: | CURRENT_VERSION=$(node -p "require('./package.json').version") echo "Current version: $CURRENT_VERSION" if [ "${{ github.event_name }}" == "release" ]; then # Use release tag as version VERSION="${{ github.event.release.tag_name }}" VERSION="${VERSION#v}" # Remove 'v' prefix if present echo "Using release version: $VERSION" elif [ "${{ github.event.inputs.version_bump }}" != "none" ]; then # Bump version npm version ${{ github.event.inputs.version_bump }} --no-git-tag-version VERSION=$(node -p "require('./package.json').version") echo "Bumped to version: $VERSION" else VERSION=$CURRENT_VERSION echo "Using current version: $VERSION" fi echo "version=$VERSION" >> $GITHUB_OUTPUT - name: Update version in package.json if: github.event_name == 'release' run: | npm version ${{ steps.version.outputs.version }} --no-git-tag-version --allow-same-version - name: Build run: npm run build - name: Publish to npm run: npm publish --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Commit version bump if: github.event.inputs.version_bump != 'none' && github.event_name == 'workflow_dispatch' run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git add package.json package-lock.json git commit -m "chore: bump version to v${{ steps.version.outputs.version }}" git push - name: Create Git tag if: github.event_name == 'workflow_dispatch' run: | git tag "v${{ steps.version.outputs.version }}" git push origin "v${{ steps.version.outputs.version }}" - name: Output Summary run: | echo "" echo "╔═══════════════════════════════════════════════════════════════════════════╗" echo "║ 📦 PartnerCore Published to npm Successfully! ║" echo "╚═══════════════════════════════════════════════════════════════════════════╝" echo "" echo "📦 Package: partnercore" echo "🔢 Version: ${{ steps.version.outputs.version }}" echo "🔗 npm: https://www.npmjs.com/package/partnercore" echo "" echo "Install:" echo " npm install -g partnercore@${{ steps.version.outputs.version }}" echo "" - name: Add to Job Summary run: | echo "## 📦 npm Publish Summary" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo "| Property | Value |" >> $GITHUB_STEP_SUMMARY echo "|----------|-------|" >> $GITHUB_STEP_SUMMARY echo "| Package | partnercore |" >> $GITHUB_STEP_SUMMARY echo "| Version | ${{ steps.version.outputs.version }} |" >> $GITHUB_STEP_SUMMARY echo "| npm URL | https://www.npmjs.com/package/partnercore |" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo "### Install" >> $GITHUB_STEP_SUMMARY echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY echo "npm install -g partnercore@${{ steps.version.outputs.version }}" >> $GITHUB_STEP_SUMMARY echo "\`\`\`" >> $GITHUB_STEP_SUMMARY

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ciellosinc/partnercore-proxy'

If you have feedback or need assistance with the MCP directory API, please join our Discord server