Skip to content

build: take the release version from the tag, not from the sources (#11) #23

build: take the release version from the tag, not from the sources (#11)

build: take the release version from the tag, not from the sources (#11) #23

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: ['20', '22', '24']
name: node ${{ matrix.node }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: npm
- run: npm ci
- name: Typecheck
run: npm run typecheck
# pretest builds, so the binary tests run against a real artefact.
- name: Test
run: npm test
# Proves what a unit test cannot: that `files` in package.json is complete
# and that the bin works through the symlink npm installs, which is how
# every `npx keenetic-mcp` invocation reaches it.
- name: Install the packed tarball and run it through npx
run: |
npm pack
mkdir -p /tmp/pkgcheck && cd /tmp/pkgcheck && npm init -y >/dev/null
npm install --no-save "$GITHUB_WORKSPACE"/keenetic-mcp-*.tgz
printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"ci","version":"0"}}}' \
| KEENETIC_HOST=192.0.2.1 KEENETIC_PASSWORD=x ./node_modules/.bin/keenetic-mcp \
| grep -q '"serverInfo"'
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '24'
cache: npm
- run: npm ci
- run: npm audit --audit-level=moderate