-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (65 loc) · 2.14 KB
/
release.yml
File metadata and controls
73 lines (65 loc) · 2.14 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
name: Publish
on:
release:
types: [published]
permissions:
contents: read
id-token: write
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- run: npm test
publish:
needs: test
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
registry-url: https://registry.npmjs.org
- run: npm install -g npm@latest
- run: npm ci
- name: Verify version from release tag
run: |
VERSION="${GITHUB_REF_NAME#v}"
ROOT_VERSION=$(node -p "require('./package.json').version")
if [ "$VERSION" != "$ROOT_VERSION" ]; then
echo "❌ Release tag v$VERSION does not match package.json version $ROOT_VERSION"
exit 1
fi
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
echo "Publishing version $VERSION"
- name: Verify all packages have same version
run: |
for pkg in mcp-server mcp-agent mcp-openclaw mcp-stdio local-keys; do
PKG_VERSION=$(node -p "require('./$pkg/package.json').version")
if [ "$PKG_VERSION" != "$VERSION" ]; then
echo "❌ $pkg has version $PKG_VERSION, expected $VERSION"
exit 1
fi
done
echo "✅ All packages at version $VERSION"
- name: Build packages (dependency order)
run: |
for pkg in local-keys mcp-server mcp-agent mcp-openclaw mcp-stdio; do
echo "Building $pkg..."
(cd $pkg && npm run build)
done
- name: Publish packages with provenance (OIDC Trusted Publishing)
run: |
for pkg in local-keys mcp-server mcp-agent mcp-openclaw mcp-stdio; do
echo "Publishing $pkg..."
(cd $pkg && npm publish --provenance --access public) || echo "⚠️ $pkg skipped (may already be at this version)"
done