- ableton-copilot-mcp
- .github
- workflows
name: npm-publish
on:
push:
tags:
- 'v*'
# 添加权限配置
permissions:
contents: write
packages: write
issues: write
jobs:
build-and-publish:
runs-on: ubuntu-latest
# 确保只在main分支上的标签推送时触发
if: github.event.base_ref == 'refs/heads/main'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org/'
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Extract version from tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Publish to NPM
run: npm publish --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
name: v${{ env.VERSION }}
body: |
Release of ableton-copilot-mcp v${{ env.VERSION }}
Please see [CHANGELOG.md](./CHANGELOG.md) for details.
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}