chore(deps): Bump the production-dependencies group with 2 updates #218
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
strategy: | |
matrix: | |
node-version: [18.x, 20.x] | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v5 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Run linter | |
run: npm run lint | |
- name: Run type check | |
run: npm run typecheck | |
- name: Run tests | |
run: npm run test:coverage | |
- name: Build | |
run: npm run build | |
- name: Upload coverage reports | |
uses: codecov/codecov-action@v5 | |
if: matrix.node-version == '20.x' | |
with: | |
file: ./coverage/lcov.info | |
flags: unittests | |
name: codecov-umbrella | |
publish: | |
needs: test | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
id-token: write # For OIDC authentication with npm | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v5 | |
- uses: actions/setup-node@v5 | |
with: | |
node-version: '20.x' | |
registry-url: 'https://registry.npmjs.org' | |
- run: npm ci | |
- run: npm run build | |
# Only publish if version was bumped | |
- name: Check if version changed | |
id: version | |
run: | | |
PUBLISHED_VERSION=$(npm view @treasuredata/mcp-server version 2>/dev/null || echo "0.0.0") | |
PACKAGE_VERSION=$(node -p "require('./package.json').version") | |
if [ "$PUBLISHED_VERSION" != "$PACKAGE_VERSION" ]; then | |
echo "changed=true" >> $GITHUB_OUTPUT | |
else | |
echo "changed=false" >> $GITHUB_OUTPUT | |
fi | |
- name: Publish to npm | |
if: steps.version.outputs.changed == 'true' | |
run: npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |