Skip to content

Commit 97ad92e

Browse files
committed
update publish-mcp action to use the other build docker flow
1 parent 6ff811f commit 97ad92e

File tree

2 files changed

+13
-38
lines changed

2 files changed

+13
-38
lines changed

.github/workflows/publish-mcp.yml

Lines changed: 12 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
name: Publish to MCP Registry
22

33
on:
4-
push:
5-
tags:
6-
- 'v*' # Triggers on version tags like v1.0.0
4+
workflow_run:
5+
workflows: ["Build and Push Docker Image"]
6+
types: [completed]
7+
branches: [main]
78

89
permissions:
910
id-token: write # Required for OIDC authentication
1011
contents: read
11-
packages: write # Required for publishing Docker images
1212

1313
jobs:
1414
publish:
@@ -19,41 +19,16 @@ jobs:
1919
with:
2020
fetch-depth: 0
2121

22-
- name: Set up Go
23-
uses: actions/setup-go@v6
24-
with:
25-
go-version: stable
26-
cache: false
27-
28-
- name: Run tests
29-
run: make test-unit
30-
31-
- name: Build binary
32-
run: make build
33-
34-
- name: Set up Docker Buildx
35-
uses: docker/setup-buildx-action@v3
36-
37-
- name: Log in to Docker Hub
38-
uses: docker/login-action@v3
39-
with:
40-
# These secrets need to be configured in GitHub repository settings
41-
username: ${{ secrets.DOCKERHUB_USERNAME }}
42-
password: ${{ secrets.DOCKERHUB_TOKEN }}
43-
4422
- name: Extract version from tag
4523
id: version
46-
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
47-
48-
- name: Build and push Docker image
49-
uses: docker/build-push-action@v5
50-
with:
51-
context: .
52-
push: true
53-
tags: |
54-
grafana/mcp-grafana:${{ steps.version.outputs.VERSION }}
55-
grafana/mcp-grafana:latest
56-
platforms: linux/amd64,linux/arm64
24+
run: |
25+
# Get the tag from the triggering workflow
26+
TAG=$(git describe --tags --exact-match HEAD 2>/dev/null || echo "")
27+
if [ -z "$TAG" ]; then
28+
echo "No tag found at HEAD"
29+
exit 1
30+
fi
31+
echo "VERSION=$TAG" >> $GITHUB_OUTPUT
5732
5833
- name: Install dependencies
5934
run: |

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Build stage
22
FROM golang:1.24-bullseye AS builder
33

4-
LABEL io.modelcontextprotocol.server.name="grafana/mcp-grafana"
4+
LABEL io.modelcontextprotocol.server.name="io.github.grafana/mcp-grafana"
55

66
# Set the working directory
77
WORKDIR /app

0 commit comments

Comments
 (0)