-
Notifications
You must be signed in to change notification settings - Fork 4
197 lines (164 loc) · 8 KB
/
Copy pathci-semantic-release.yml
File metadata and controls
197 lines (164 loc) · 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
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
name: CI - Semantic Release
# This workflow is triggered on every push to the main branch
# It publishes to npm and creates GitHub releases with DXT artifacts
on:
push:
branches: [main]
jobs:
release:
name: Semantic Release
runs-on: ubuntu-latest
environment: release
permissions:
contents: write
issues: write
pull-requests: write
steps:
# Step 1: Check out the full Git history
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
# Step 2: Setup Node.js environment
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
# Step 3: Install dependencies
- name: Install dependencies
run: |
npm ci
npm install -g @anthropic-ai/dxt
# Step 4: Build the package
- name: Build
run: |
npm run build
chmod +x dist/index.js
# Step 5: Run tests
- name: Run tests
run: npm test
# Step 6: Configure Git identity
- name: Configure Git User
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
# Step 7: Get version from package.json
- name: Get version
id: get-version
run: |
VERSION=$(node -p "require('./package.json').version")
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Current version: $VERSION"
# Step 8: Create and sign DXT package
- name: Create DXT Package
id: create-dxt
env:
SIGNING_CERT: ${{ secrets.SIGNING_CERT }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
run: |
# Prepare release directory
node scripts/prepare-release.js ${{ steps.get-version.outputs.version }}
# Sign DXT package
DXT_FILE="release/lokalise-mcp-${{ steps.get-version.outputs.version }}.dxt"
if [ -n "${SIGNING_CERT}" ] && [ -n "${SIGNING_KEY}" ]; then
echo "🏭 Using production certificates"
mkdir -p certs
echo "${SIGNING_CERT}" | base64 -d > certs/cert.pem
echo "${SIGNING_KEY}" | base64 -d > certs/key.pem
dxt sign "$DXT_FILE" --cert certs/cert.pem --key certs/key.pem
rm -rf certs/
else
echo "🔧 Using self-signed certificate"
dxt sign "$DXT_FILE" --self-signed
fi
dxt clean "$DXT_FILE"
echo "dxt_file=$DXT_FILE" >> $GITHUB_OUTPUT
# Step 9: Publish to npm
- name: Publish to npm
id: npm-publish
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
# Check if this version is already published
NPM_VERSION=$(npm view lokalise-mcp version 2>/dev/null || echo "0.0.0")
CURRENT_VERSION=${{ steps.get-version.outputs.version }}
if [ "$NPM_VERSION" = "$CURRENT_VERSION" ]; then
echo "Version $CURRENT_VERSION is already published to npm"
echo "published=false" >> $GITHUB_OUTPUT
else
echo "Publishing version $CURRENT_VERSION to npm"
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
npm publish
echo "published=true" >> $GITHUB_OUTPUT
fi
# Step 10: Create GitHub Release
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.get-version.outputs.version }}
name: v${{ steps.get-version.outputs.version }}
draft: false
prerelease: false
generate_release_notes: true
files: |
release/lokalise-mcp-${{ steps.get-version.outputs.version }}.dxt
release/checksums.sha256
release/lokalise-mcp-${{ steps.get-version.outputs.version }}.tgz
body: |
## 🎉 Lokalise MCP Server v${{ steps.get-version.outputs.version }}
### 📦 Installation
#### 1) Smithery (Recommended)
Automated install and configuration for popular MCP clients.
```bash
# Claude Desktop
npx -y @smithery/cli install @AbdallahAHO/lokalise-mcp --client claude
# Cursor
npx -y @smithery/cli install @AbdallahAHO/lokalise-mcp --client cursor
# VS Code (Claude Code)
npx -y @smithery/cli install @AbdallahAHO/lokalise-mcp --client vscode
# Claude Code
claude mcp add --transport http abdallah-aho-lokalise-mcp "https://server.smithery.ai/@AbdallahAHO/lokalise-mcp/mcp"
# Gemini CLI
npx -y @smithery/cli install @AbdallahAHO/lokalise-mcp --client gemini
```
Inspect tools before installing:
```bash
npx -y @smithery/cli@latest inspect @AbdallahAHO/lokalise-mcp
```
#### 2) Claude Desktop Extension (DXT)
Download and double-click `lokalise-mcp-${{ steps.get-version.outputs.version }}.dxt` to install in ClaudeDesktop.
When prompted, enter your `LOKALISE_API_KEY`. Updates by installing the newer `.dxt`.
#### 3) Local (clone + run)
```bash
git clone https://github.com/AbdallahAHO/lokalise-mcp.git
cd lokalise-mcp
npm install
export LOKALISE_API_KEY="your-api-key-here"
npm run mcp:http # HTTP (SSE) at http://localhost:3000/mcp
# or
npm run mcp:stdio # STDIO
```
### 🔐 Verify Downloads
```bash
sha256sum -c checksums.sha256
```
### 📋 What's Changed
See the full changelog below for all changes in this release.
# Step 12: Summary
- name: Release Summary
run: |
echo "## 🚀 Release Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **Version**: ${{ steps.get-version.outputs.version }}" >> $GITHUB_STEP_SUMMARY
echo "- **npm Published**: ${{ steps.npm-publish.outputs.published }}" >> $GITHUB_STEP_SUMMARY
echo "- **GitHub Release**: ✅" >> $GITHUB_STEP_SUMMARY
echo "- **Back-merge Status**: Check workflow logs" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### 📋 Release Assets" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
ls -la release/ >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "[View Release](https://github.com/${{ github.repository }}/releases/tag/v${{ steps.get-version.outputs.version }})" >> $GITHUB_STEP_SUMMARY