Skip to main content
Glama
publish.yml4.14 kB
name: Release on: push: tags: - 'v*.*.*' permissions: id-token: write contents: read jobs: validate-release: runs-on: ubuntu-latest outputs: version: ${{ steps.validate.outputs.version }} should-release: ${{ steps.validate.outputs.should-release }} steps: - name: Checkout code uses: actions/checkout@v4 - name: Validate version and tag match id: validate run: | # Extract version from git tag TAG_VERSION=${GITHUB_REF#refs/tags/v} echo "Tag version: $TAG_VERSION" # Get version from package.json PACKAGE_VERSION=$(node -p "require('./package.json').version") echo "Package version: $PACKAGE_VERSION" # Check if versions match if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then echo "❌ Version mismatch: tag ($TAG_VERSION) != package.json ($PACKAGE_VERSION)" echo "should-release=false" >> $GITHUB_OUTPUT exit 1 fi echo "version=$PACKAGE_VERSION" >> $GITHUB_OUTPUT # Check if version already exists on npm if npm view "@genwave/svgmaker-mcp@$PACKAGE_VERSION" version >/dev/null 2>&1; then echo "should-release=false" >> $GITHUB_OUTPUT echo "❌ Version $PACKAGE_VERSION already exists on npm - skipping release" else echo "should-release=true" >> $GITHUB_OUTPUT echo "✅ Version $PACKAGE_VERSION is valid and ready for release" fi release: runs-on: ubuntu-latest needs: validate-release if: needs.validate-release.outputs.should-release == 'true' permissions: contents: write id-token: write steps: - name: Checkout code uses: actions/checkout@v4 with: fetch-depth: 0 - name: Use Node.js 20.x uses: actions/setup-node@v6 with: node-version: 20.x cache: 'npm' registry-url: 'https://registry.npmjs.org' - name: Update npm for OIDC support run: npm install -g npm@latest - name: Install dependencies run: npm ci - name: Run tests run: npm test || echo "No tests to run" - name: Run linting run: npm run lint || echo "No linting configured" - name: Build package run: npm run build - name: Generate changelog id: changelog run: | VERSION="${{ needs.validate-release.outputs.version }}" # Generate changelog entry if [ -f CHANGELOG.md ]; then # Extract changelog entry for this version CHANGELOG_ENTRY=$(sed -n "/## \[$VERSION\]/,/## \[/p" CHANGELOG.md | sed '$d') if [ -z "$CHANGELOG_ENTRY" ]; then CHANGELOG_ENTRY="Release $VERSION" fi else CHANGELOG_ENTRY="Release $VERSION" fi # Save changelog to output { echo 'CHANGELOG_CONTENT<<EOF' echo "$CHANGELOG_ENTRY" echo 'EOF' } >> $GITHUB_OUTPUT - name: Publish to npm run: | VERSION="${{ needs.validate-release.outputs.version }}" echo "Publishing version $VERSION to npm..." npm publish --provenance - name: Create GitHub Release uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: v${{ needs.validate-release.outputs.version }} release_name: Release ${{ needs.validate-release.outputs.version }} body: ${{ steps.changelog.outputs.CHANGELOG_CONTENT }} draft: false prerelease: ${{ contains(needs.validate-release.outputs.version, '-') }} - name: Notify success if: success() run: | VERSION="${{ needs.validate-release.outputs.version }}" echo "✅ Successfully released version $VERSION" echo "📦 Package published to npm: https://www.npmjs.com/package/@genwave/svgmaker-mcp" echo "🚀 GitHub release created: ${{ github.server_url }}/${{ github.repository }}/releases/tag/v$VERSION"

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/GenWaveLLC/svgmaker-mcp'

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