Skip to content

Commit 084727d

Browse files
committed
CI/CD for npm
1 parent fb197e1 commit 084727d

File tree

3 files changed

+102
-2
lines changed

3 files changed

+102
-2
lines changed

.github/workflows/merge-main.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,64 @@ jobs:
2727
- name: Run ESLint
2828
run: npm run lint
2929

30+
build:
31+
runs-on: ubuntu-latest
32+
33+
steps:
34+
- name: Checkout code
35+
uses: actions/checkout@v4.1.1
36+
37+
- name: Set up Node.js
38+
uses: actions/setup-node@v4.0.1
39+
with:
40+
node-version: 20
41+
42+
- name: Install dependencies
43+
run: npm ci
44+
45+
- name: Build
46+
run: npm run build
47+
48+
npm-publish:
49+
needs: [linting, build]
50+
runs-on: ubuntu-latest
51+
if: always() && needs.linting.result == 'success' && needs.build.result == 'success'
52+
53+
steps:
54+
- name: Checkout code
55+
uses: actions/checkout@v4.1.1
56+
57+
- name: Set up Node.js
58+
uses: actions/setup-node@v4.0.1
59+
with:
60+
node-version: 20
61+
registry-url: 'https://registry.npmjs.org'
62+
63+
- name: Install dependencies
64+
run: npm ci
65+
66+
- name: Build
67+
run: npm run build
68+
69+
- name: Check if version changed
70+
id: version-check
71+
run: |
72+
PACKAGE_VERSION=$(node -p "require('./package.json').version")
73+
NPM_VERSION=$(npm view linkedapi-mcp version 2>/dev/null || echo "0.0.0")
74+
if [ "$PACKAGE_VERSION" != "$NPM_VERSION" ]; then
75+
echo "should_publish=true" >> $GITHUB_OUTPUT
76+
echo "Version changed: $NPM_VERSION -> $PACKAGE_VERSION"
77+
else
78+
echo "should_publish=false" >> $GITHUB_OUTPUT
79+
echo "Version unchanged: $PACKAGE_VERSION"
80+
fi
81+
82+
- name: Publish to npm
83+
if: steps.version-check.outputs.should_publish == 'true'
84+
run: npm publish
85+
env:
86+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
87+
3088
build-push:
3189
needs: [linting]
3290
runs-on: ubuntu-latest

.github/workflows/pr-main.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: PR Sent -> main
2+
3+
on:
4+
pull_request:
5+
branches: ['main']
6+
7+
jobs:
8+
linting:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4.1.1
14+
15+
- name: Set up Node.js
16+
uses: actions/setup-node@v4.0.1
17+
with:
18+
node-version: 20
19+
20+
- name: Install dependencies
21+
run: npm ci
22+
23+
- name: Run ESLint
24+
run: npm run lint
25+
26+
build:
27+
runs-on: ubuntu-latest
28+
29+
steps:
30+
- name: Checkout code
31+
uses: actions/checkout@v4.1.1
32+
33+
- name: Set up Node.js
34+
uses: actions/setup-node@v4.0.1
35+
with:
36+
node-version: 20
37+
38+
- name: Install dependencies
39+
run: npm ci
40+
41+
- name: Build
42+
run: npm run build

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "linkedapi-mcp",
3-
"version": "0.3.4",
4-
"description": "MCP server for Linked API",
3+
"version": "0.3.6",
4+
"description": "MCP server that lets AI assistants control LinkedIn accounts and retrieve real-time data.",
55
"main": "dist/index.js",
66
"bin": {
77
"linkedapi-mcp": "dist/index.js"

0 commit comments

Comments
 (0)