Skip to main content
Glama
publish.yml6.77 kB
name: Publish on: workflow_dispatch: defaults: run: working-directory: . permissions: contents: read jobs: setup: name: Setup runs-on: ubuntu-latest outputs: release_version: ${{ steps.version-output.outputs.version }} permissions: contents: read steps: - name: Version id: version-output run: | VERSION=$(curl "https://api.github.com/repos/withinfocus/tba-mcp-server/releases" | jq -r '.[] | select(.tag_name | contains("v")) | .tag_name' | head -1 | sed 's/^v//') echo "Latest released version: $VERSION" echo "version=$VERSION" >> "$GITHUB_OUTPUT" publish-ghpr: name: GHPR runs-on: ubuntu-latest needs: - setup permissions: contents: read deployments: write packages: write env: _PKG_VERSION: ${{ needs.setup.outputs.release_version }} steps: - name: Checkout uses: actions/checkout@v6 with: ref: refs/tags/v${{ env._PKG_VERSION }} - name: Deployment uses: chrnorm/deployment-action@v2 id: deployment with: token: "${{ secrets.GITHUB_TOKEN }}" initial-status: "in_progress" environment: "GHPR" description: "Deployment ${{ needs.setup.outputs.release_version }} from branch ${{ github.ref_name }}" task: release - name: Node version id: retrieve-node-version run: | NODE_NVMRC=$(cat .nvmrc) NODE_VERSION=${NODE_NVMRC/v/''} echo "node_version=$NODE_VERSION" >> "$GITHUB_OUTPUT" - name: Node uses: actions/setup-node@v6 with: cache: "npm" cache-dependency-path: "**/package-lock.json" node-version: ${{ steps.retrieve-node-version.outputs.node_version }} - name: NPM run: npm install -g npm@latest husky - name: Download run: | wget "https://github.com/${{ github.repository }}/releases/download/v${{ env._PKG_VERSION }}/mcp-server-${{ env._PKG_VERSION }}.zip" unzip "mcp-server-${{ env._PKG_VERSION }}.zip" - name: Setup run: | echo 'registry="https://npm.pkg.github.com/"' > ./.npmrc echo "//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN" >> ./.npmrc env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Publish run: npm publish --access public --registry=https://npm.pkg.github.com/ --userconfig=./.npmrc - name: Success if: ${{ success() }} uses: chrnorm/deployment-status@v2 with: token: "${{ secrets.GITHUB_TOKEN }}" state: "success" deployment-id: ${{ steps.deployment.outputs.deployment_id }} - name: Failure if: ${{ failure() }} uses: chrnorm/deployment-status@v2 with: token: "${{ secrets.GITHUB_TOKEN }}" state: "failure" deployment-id: ${{ steps.deployment.outputs.deployment_id }} publish-npm: name: NPM runs-on: ubuntu-latest needs: - setup permissions: contents: read deployments: write id-token: write packages: read env: _PKG_VERSION: ${{ needs.setup.outputs.release_version }} steps: - name: Checkout uses: actions/checkout@v6 with: ref: refs/tags/v${{ env._PKG_VERSION }} - name: Deployment uses: chrnorm/deployment-action@v2 id: deployment with: token: "${{ secrets.GITHUB_TOKEN }}" initial-status: "in_progress" environment: "NPM" description: "Deployment ${{ needs.setup.outputs.release_version }} from branch ${{ github.ref_name }}" task: release - name: Node version id: retrieve-node-version run: | NODE_NVMRC=$(cat .nvmrc) NODE_VERSION=${NODE_NVMRC/v/''} echo "node_version=$NODE_VERSION" >> "$GITHUB_OUTPUT" - name: Node uses: actions/setup-node@v6 with: cache: "npm" cache-dependency-path: "**/package-lock.json" node-version: ${{ steps.retrieve-node-version.outputs.node_version }} - name: NPM run: npm install -g npm@latest husky - name: Download run: | wget https://github.com/${{ github.repository }}/releases/download/v${{ env._PKG_VERSION }}/mcp-server-${{ env._PKG_VERSION }}.zip unzip mcp-server-${{ env._PKG_VERSION }}.zip - name: Publish run: npm publish --access public - name: Success if: ${{ success() }} uses: chrnorm/deployment-status@v2 with: token: "${{ secrets.GITHUB_TOKEN }}" state: "success" deployment-id: ${{ steps.deployment.outputs.deployment_id }} - name: Failure if: ${{ failure() }} uses: chrnorm/deployment-status@v2 with: token: "${{ secrets.GITHUB_TOKEN }}" state: "failure" deployment-id: ${{ steps.deployment.outputs.deployment_id }} publish-ghcr: name: GHCR runs-on: ubuntu-latest needs: - setup permissions: contents: read deployments: write packages: write env: _RELEASE_TAG: ${{ needs.setup.outputs.release_version }} _IMAGE_NAME: ghcr.io/withinfocus/tba-mcp-server steps: - name: Deployment uses: chrnorm/deployment-action@v2 id: deployment with: token: "${{ secrets.GITHUB_TOKEN }}" initial-status: "in_progress" environment: "GHCR" description: "Deployment ${{ needs.setup.outputs.release_version }} from branch ${{ github.ref_name }}" task: release - name: Login uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Docker run: | docker pull "${{ env._IMAGE_NAME }}:${{ env._RELEASE_TAG }}" docker tag "${{ env._IMAGE_NAME }}:${{ env._RELEASE_TAG }}" "${{ env._IMAGE_NAME }}:latest" docker push "${{ env._IMAGE_NAME }}:latest" - name: Success if: ${{ success() }} uses: chrnorm/deployment-status@v2 with: token: "${{ secrets.GITHUB_TOKEN }}" state: "success" deployment-id: ${{ steps.deployment.outputs.deployment_id }} - name: Failure if: ${{ failure() }} uses: chrnorm/deployment-status@v2 with: token: "${{ secrets.GITHUB_TOKEN }}" state: "failure" deployment-id: ${{ steps.deployment.outputs.deployment_id }} - name: Logout run: docker logout ghcr.io

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/withinfocus/tba'

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