-
Notifications
You must be signed in to change notification settings - Fork 6
91 lines (74 loc) · 2.8 KB
/
release.yml
File metadata and controls
91 lines (74 loc) · 2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Publish Release
on:
push:
branches:
- main
paths:
- 'pkg/catalog/*/data/**'
permissions:
contents: write
jobs:
release:
name: Publish Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Generate version
id: metadata
run: |
echo "version=0.$(date +'%Y%m%d').0" >> $GITHUB_OUTPUT
echo "date=$(date +'%Y.%m.%d')" >> $GITHUB_OUTPUT
- name: Collect registry stats
id: stats
run: |
for registry_dir in pkg/catalog/*/; do
registry_name=$(basename "$registry_dir")
data_file="$registry_dir/data/registry.json"
[ -f "$data_file" ] || continue
CONTAINER_COUNT=$(jq '.servers | length' "$data_file")
REMOTE_COUNT=$(jq '.remote_servers | length // 0' "$data_file")
TOTAL=$((CONTAINER_COUNT + REMOTE_COUNT))
LAST_UPDATED=$(jq -r '.last_updated' "$data_file")
echo "${registry_name}_total=$TOTAL" >> $GITHUB_OUTPUT
echo "${registry_name}_container=$CONTAINER_COUNT" >> $GITHUB_OUTPUT
echo "${registry_name}_remote=$REMOTE_COUNT" >> $GITHUB_OUTPUT
echo "${registry_name}_last_updated=$LAST_UPDATED" >> $GITHUB_OUTPUT
done
- name: Create or update release
uses: ncipollo/release-action@v1
with:
tag: v${{ steps.metadata.outputs.version }}
name: Catalog v${{ steps.metadata.outputs.date }}
body: |
## ToolHive Catalog Release
**Date**: ${{ steps.metadata.outputs.date }}
**Last Updated**: ${{ steps.stats.outputs.toolhive_last_updated }}
### Statistics
| Category | Count |
|----------|-------|
| **Total Servers** | ${{ steps.stats.outputs.toolhive_total }} |
| **Container-based** | ${{ steps.stats.outputs.toolhive_container }} |
| **Remote** | ${{ steps.stats.outputs.toolhive_remote }} |
### Usage
```sh
go get github.com/stacklok/toolhive-catalog/pkg/catalog/toolhive@latest
```
```go
import "github.com/stacklok/toolhive-catalog/pkg/catalog/toolhive"
// ToolHive legacy format
data := toolhive.Legacy()
// Upstream MCP format
data := toolhive.Upstream()
```
---
*This is an automated release triggered by a catalog data update.*
artifacts: |
pkg/catalog/toolhive/data/registry.json
pkg/catalog/toolhive/data/official-registry.json
allowUpdates: true
makeLatest: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}