Skip to content

Commit ac75c8c

Browse files
stex2005rjohn-v
andauthored
Hotfix/workflows (#167)
* Manual fixes to workflows * Changes to publish.yml * Removed branch restriction on publish mcp * Removed branch restriction on download metrics --------- Co-authored-by: Rohit John Varghese <rohit@contoro.com>
1 parent f583ba4 commit ac75c8c

File tree

5 files changed

+96
-7
lines changed

5 files changed

+96
-7
lines changed

.github/workflows/clone-metrics.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
name: Track Clone Metrics
22

33
on:
4+
workflow_dispatch:
45
schedule:
56
- cron: '0 8 * * *' # Run every day at 8am
6-
workflow_dispatch:
7+
78

89
jobs:
910
clone-stats:

.github/workflows/download-metrics.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ on:
44
workflow_dispatch:
55
workflow_run:
66
workflows: ["Track View Metrics"] # exact name of PyPI workflow
7-
types:
8-
- completed
7+
types: [completed]
98

109
jobs:
1110
download-stats:

.github/workflows/publish.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Publish (PyPI + MCP Registry)
2+
3+
on:
4+
workflow_dispatch:
5+
6+
concurrency:
7+
group: publish-${{ github.ref }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
pypi:
12+
name: Publish to PyPI
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
id-token: write # REQUIRED for PyPI Trusted Publishing (OIDC)
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: "3.12"
25+
26+
- name: Install uv
27+
run: pipx install uv
28+
29+
# --- Optional checks (keep for now; can be moved to PR CI later) ---
30+
- name: Sync deps
31+
run: uv sync
32+
33+
- name: Ruff lint
34+
run: uvx ruff check .
35+
36+
- name: Ruff format check
37+
run: uvx ruff format --check .
38+
39+
- name: Run tests (if present)
40+
run: |
41+
if [ -d tests ]; then
42+
uv run pytest -q
43+
else
44+
echo "No tests/ directory; skipping."
45+
fi
46+
47+
# --- Build artifacts for PyPI ---
48+
- name: Build sdist & wheel
49+
run: uv build
50+
51+
# --- Publish using Trusted Publishing (no tokens) ---
52+
- name: Publish to PyPI
53+
uses: pypa/gh-action-pypi-publish@release/v1
54+
with:
55+
packages-dir: dist
56+
# For a dress rehearsal, you can set:
57+
# repository-url: https://test.pypi.org/legacy/
58+
59+
registry:
60+
name: Publish to MCP Registry
61+
runs-on: ubuntu-latest
62+
needs: pypi
63+
permissions:
64+
contents: read
65+
id-token: write # REQUIRED for MCP Registry GitHub OIDC login
66+
steps:
67+
- name: Checkout
68+
uses: actions/checkout@v4
69+
70+
# Small delay to allow PyPI metadata to propagate
71+
- name: Wait briefly
72+
run: sleep 20
73+
74+
- name: Install MCP Publisher
75+
run: |
76+
set -e
77+
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
78+
ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')
79+
echo "Get the latest release version"
80+
LATEST_VERSION=$(curl -s https://api.github.com/repos/modelcontextprotocol/registry/releases/latest | jq -r '.tag_name')
81+
echo "Installing MCP Publisher version: $LATEST_VERSION"
82+
curl -L "https://github.com/modelcontextprotocol/registry/releases/download/${LATEST_VERSION}/mcp-publisher_${LATEST_VERSION#v}_${OS}_${ARCH}.tar.gz" \
83+
| tar xz mcp-publisher
84+
85+
- name: Login to MCP Registry (OIDC)
86+
run: ./mcp-publisher login github-oidc
87+
88+
- name: Publish server.json to MCP Registry
89+
run: ./mcp-publisher publish

.github/workflows/publish_mcp.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ on:
55
workflow_run:
66
workflows: ["Publish PyPI"]
77
types: [completed]
8-
branches: [main]
98

109
concurrency:
1110
group: publish-${{ github.ref }}

.github/workflows/view-metrics.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
name: Track View Metrics via GitHub App
1+
name: Track View Metrics
22

33
on:
4-
schedule:
5-
- cron: '30 * * * *' # Run every hour at minute 30
64
workflow_dispatch:
5+
workflow_run:
6+
workflows: ["Track Clone Metrics"] # exact name of PyPI workflow
7+
types: [completed]
78

89
jobs:
910
view-stats:

0 commit comments

Comments
 (0)