-
Notifications
You must be signed in to change notification settings - Fork 1
135 lines (110 loc) · 4.05 KB
/
version-release.yml
File metadata and controls
135 lines (110 loc) · 4.05 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Version and Release
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: write
jobs:
version:
runs-on: ubuntu-latest
outputs:
changed: ${{ steps.changed.outputs.changed }}
version: ${{ steps.version.outputs.version }}
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: 'lts/*'
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Bump version
id: bump
run: |
bash scripts/bump-version.sh
- name: Get new version
id: version
run: |
NEW_VERSION=$(node -p "require('./package.json').version")
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
echo "New version: $NEW_VERSION"
- name: Check if version changed
id: changed
run: |
if git diff --quiet package.json; then
echo "changed=false" >> $GITHUB_OUTPUT
echo "No version change detected"
else
echo "changed=true" >> $GITHUB_OUTPUT
echo "Version changed detected"
fi
- name: Commit version bump
if: steps.changed.outputs.changed == 'true'
run: |
git add package.json package-lock.json server.json
git commit -m "chore: bump version to ${{ steps.version.outputs.version }}"
git push origin main
- name: Create and push tag
if: steps.changed.outputs.changed == 'true'
run: |
git tag -a "v${{ steps.version.outputs.version }}" -m "Release v${{ steps.version.outputs.version }}"
git push origin "v${{ steps.version.outputs.version }}"
- name: Create GitHub Release
if: steps.changed.outputs.changed == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Generate release notes from commits
LAST_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
if [ -z "$LAST_TAG" ]; then
COMMITS=$(git log --pretty=format:"- %s (%h)" HEAD^..HEAD)
else
COMMITS=$(git log --pretty=format:"- %s (%h)" "$LAST_TAG"..HEAD^)
fi
# Create release
gh release create "v${{ steps.version.outputs.version }}" \
--title "v${{ steps.version.outputs.version }}" \
--notes "## Changes
$COMMITS"
publish:
runs-on: ubuntu-latest
needs: version
if: needs.version.outputs.changed == 'true'
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
ref: v${{ needs.version.outputs.version }}
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: 'lts/*'
- name: Install dependencies
run: npm ci
- name: Run lint
run: npm run lint
- name: Run type check
run: npm run type-check
- name: Install MCP Publisher
run: |
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')
RELEASE_TAG=$(curl -s https://api.github.com/repos/modelcontextprotocol/registry/releases | \
jq -r '.[] | select(.assets | map(.name) | any(test("mcp-publisher_"))) | .tag_name' | head -1)
echo "Downloading mcp-publisher ${RELEASE_TAG} for ${OS}_${ARCH}"
curl -fL "https://github.com/modelcontextprotocol/registry/releases/download/${RELEASE_TAG}/mcp-publisher_${OS}_${ARCH}.tar.gz" | tar xz
chmod +x mcp-publisher
- name: Login to MCP Registry
env:
MCP_PRIVATE_KEY: ${{ secrets.MCP_PRIVATE_KEY }}
run: ./mcp-publisher login dns --domain docusign-navigator.thisdot.co --private-key "$MCP_PRIVATE_KEY"
- name: Publish to MCP Registry
run: ./mcp-publisher publish