Skip to content

Commit 250723d

Browse files
authored
Simplify Registry release pipeline (#1204)
* Improve registry release reliablilty * Remove trigger from docker build pipeline * Remove whitespace and publish from version release * Add whitespave for neater pr
1 parent f9343e6 commit 250723d

File tree

2 files changed

+9
-31
lines changed

2 files changed

+9
-31
lines changed

.github/workflows/docker-publish.yml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -127,19 +127,4 @@ jobs:
127127
# This step uses the identity token to provision an ephemeral certificate
128128
# against the sigstore community Fulcio instance.
129129
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
130-
131-
- name: Trigger registry publication
132-
if: ${{ github.event_name != 'pull_request' && github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v') }}
133-
uses: actions/github-script@v7
134-
with:
135-
script: |
136-
await github.rest.repos.createDispatchEvent({
137-
owner: context.repo.owner,
138-
repo: context.repo.repo,
139-
event_type: 'docker-published',
140-
client_payload: {
141-
tag: context.ref.replace('refs/tags/', ''),
142-
sha: context.sha,
143-
image_digest: '${{ steps.build-and-push.outputs.digest }}'
144-
}
145-
});
130+

.github/workflows/registry-releaser.yml

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

33
on:
4-
repository_dispatch:
5-
types: [docker-published] # Triggered after Docker image is published
4+
push:
5+
tags: ["v*"] # Triggers on version tags like v1.0.0
66
workflow_dispatch: # Allow manual triggering
77

88
jobs:
@@ -23,32 +23,28 @@ jobs:
2323

2424
- name: Fetch tags
2525
run: |
26-
if [[ "${{ github.event_name }}" == "repository_dispatch" ]]; then
27-
echo "Triggered by docker-published event for tag: ${{ github.event.client_payload.tag }}"
28-
elif [[ "${{ github.ref_type }}" != "tag" ]]; then
26+
if [[ "${{ github.ref_type }}" != "tag" ]]; then
2927
git fetch --tags
3028
else
3129
echo "Skipping tag fetch - already on tag ${{ github.ref_name }}"
3230
fi
3331
3432
- name: Wait for Docker image
3533
run: |
36-
if [[ "${{ github.event_name }}" == "repository_dispatch" ]]; then
37-
TAG="${{ github.event.client_payload.tag }}"
38-
elif [[ "${{ github.ref_type }}" == "tag" ]]; then
34+
if [[ "${{ github.ref_type }}" == "tag" ]]; then
3935
TAG="${{ github.ref_name }}"
4036
else
4137
TAG=$(git tag --sort=-version:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+' | head -n1)
4238
fi
4339
IMAGE="ghcr.io/github/github-mcp-server:$TAG"
4440
45-
for i in {1..6}; do
41+
for i in {1..10}; do
4642
if docker manifest inspect "$IMAGE" &>/dev/null; then
4743
echo "✅ Docker image ready: $TAG"
4844
break
4945
fi
50-
[ $i -eq 6 ] && { echo "❌ Timeout waiting for $TAG after 3 minutes"; exit 1; }
51-
echo "⏳ Waiting for Docker image ($i/6)..."
46+
[ $i -eq 10 ] && { echo "❌ Timeout waiting for $TAG after 5 minutes"; exit 1; }
47+
echo "⏳ Waiting for Docker image ($i/10)..."
5248
sleep 30
5349
done
5450
@@ -60,10 +56,7 @@ jobs:
6056
6157
- name: Update server.json version
6258
run: |
63-
if [[ "${{ github.event_name }}" == "repository_dispatch" ]]; then
64-
TAG_VERSION=$(echo "${{ github.event.client_payload.tag }}" | sed 's/^v//')
65-
echo "Using tag from dispatch: ${{ github.event.client_payload.tag }}"
66-
elif [[ "${{ github.ref_type }}" == "tag" ]]; then
59+
if [[ "${{ github.ref_type }}" == "tag" ]]; then
6760
TAG_VERSION=$(echo "${{ github.ref_name }}" | sed 's/^v//')
6861
else
6962
LATEST_TAG=$(git tag --sort=-version:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+(-.*)?$' | head -n 1)

0 commit comments

Comments
 (0)