Skip to content

Release

Release #11

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
versionType:
description: 'Version type (patch, minor, major)'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
node-version: '20'
check-latest: true
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Update versions
run: |
NEW_VERSION=$(npm version ${{ github.event.inputs.versionType }} --no-git-tag-version)
NEW_VERSION=${NEW_VERSION#v} # Remove 'v' prefix
# Update TypeScript files
sed -i "s/version: \"[^\"]*\"/version: \"$NEW_VERSION\"/" src/index.ts
sed -i "s/version: \"[^\"]*\"/version: \"$NEW_VERSION\"/" src/stdio-server.ts
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
- name: Build and package
run: npm run package
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --local user.name 'github-actions[bot]'
git config --local user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add package.json package-lock.json src/index.ts src/stdio-server.ts
git commit -m "Release v${NEW_VERSION}"
git tag "v${NEW_VERSION}"
git push origin main --tags
gh release create "v${NEW_VERSION}" \
--title "finmap-mcp v${NEW_VERSION}" \
--generate-notes \
--latest \
dist/*.tgz