Skip to content

Commit f987e84

Browse files
Add CI workflow
1 parent 6b51647 commit f987e84

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed

.github/workflows/ci.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build-and-test:
11+
name: Build ${{ matrix.rid }}
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
include:
16+
- os: ubuntu-latest
17+
rid: linux-x64
18+
binary: MAKER.McpServer
19+
- os: windows-latest
20+
rid: win-x64
21+
binary: MAKER.McpServer.exe
22+
- os: macos-latest
23+
rid: osx-x64
24+
binary: MAKER.McpServer
25+
- os: macos-latest
26+
rid: osx-arm64
27+
binary: MAKER.McpServer
28+
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- uses: actions/setup-dotnet@v4
33+
with:
34+
dotnet-version: '8.0.x'
35+
36+
- name: Publish & package
37+
shell: bash
38+
run: |
39+
dotnet publish MAKER.McpServer/MAKER.McpServer.csproj \
40+
-c Release \
41+
-r ${{ matrix.rid }} \
42+
--self-contained true \
43+
-p:PublishSingleFile=true \
44+
-p:DebugType=none \
45+
-o ./dist
46+
47+
# Rename to a consistent binary name
48+
if [[ "${{ matrix.rid }}" == win-* ]]; then
49+
mv ./dist/${{ matrix.binary }} ./dist/maker-mcp.exe
50+
else
51+
mv ./dist/${{ matrix.binary }} ./dist/maker-mcp
52+
chmod +x ./dist/maker-mcp
53+
fi
54+
55+
# Bundle binary + appsettings + instruction files into a tarball
56+
tar -czf maker-mcp-${{ matrix.rid }}.tar.gz -C ./dist .
57+
58+
- uses: actions/setup-node@v4
59+
with:
60+
node-version: '20'
61+
registry-url: 'https://npm.pkg.github.com'
62+
63+
# Sync package.json version with the git tag (strips the 'v' prefix)
64+
- name: Set version
65+
run: |
66+
VERSION="${GITHUB_REF_NAME#v}"
67+
npm version "$VERSION" --no-git-tag-version --allow-same-version
68+
working-directory: MAKER.Npm
69+
70+
- name: npm test
71+
run: npm test
72+
fi
73+
working-directory: MAKER.Npm

0 commit comments

Comments
 (0)