Image Generation MCP Server
by manascb1344
- .github
- workflows
name: Publish Package to npmjs
on:
push:
branches: ['**']
tags: ['*']
paths:
- '**.js'
- '**.ts'
- 'package.json'
- 'package-lock.json'
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- run: npm install
- name: Get current version and increment
id: version
run: |
CURRENT_VERSION=$(npm view together-mcp version)
IFS='.' read -ra VERSION_PARTS <<< "$CURRENT_VERSION"
PATCH=$((VERSION_PARTS[2] + 1))
NEW_VERSION="${VERSION_PARTS[0]}.${VERSION_PARTS[1]}.$PATCH"
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_OUTPUT
env:
NPM_CONFIG_USERCONFIG: /home/runner/work/_temp/.npmrc
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Update package version
run: |
npm version ${{ steps.version.outputs.NEW_VERSION }} --no-git-tag-version
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add package.json
git commit -m "Bump version to ${{ steps.version.outputs.NEW_VERSION }} via GitHub Actions"
git push
- name: Publish package
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}