Skip to content

docs: add release notes for v1.0.1 #6

docs: add release notes for v1.0.1

docs: add release notes for v1.0.1 #6

Workflow file for this run

name: Publish to npm
on:
push:
branches:
- main
release:
types: [published]
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
python-version: ['3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
npm ci
uv pip install --system --python python${{ matrix.python-version }} -e .
- name: Run validation
run: npm run validate
- name: Test Python import
run: |
python -c "from mcp_server_bwt import version; print('Version:', version.__version__)"
publish:
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'release' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
npm ci
uv pip install --system --python python3.11 -e .
- name: Check if version changed
id: version-check
run: |
# Get the current version from package.json
CURRENT_VERSION=$(node -p "require('./package.json').version")
echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
# Check if this version is already published
if npm view @isiahw1/mcp-server-bing-webmaster@$CURRENT_VERSION version 2>/dev/null; then
echo "Version $CURRENT_VERSION already exists on npm"
echo "should_publish=false" >> $GITHUB_OUTPUT
else
echo "Version $CURRENT_VERSION not found on npm, will publish"
echo "should_publish=true" >> $GITHUB_OUTPUT
fi
- name: Build
if: steps.version-check.outputs.should_publish == 'true'
run: npm run build
- name: Publish to npm
if: steps.version-check.outputs.should_publish == 'true'
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create GitHub Release (if push to main)
if: github.event_name == 'push' && steps.version-check.outputs.should_publish == 'true'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.version-check.outputs.current_version }}
release_name: Release v${{ steps.version-check.outputs.current_version }}
body: |
Automated release for version ${{ steps.version-check.outputs.current_version }}
## Changes
See [commit history](https://github.com/${{ github.repository }}/compare/v${{ steps.version-check.outputs.previous_version }}...v${{ steps.version-check.outputs.current_version }}) for details.
draft: false
prerelease: false