Skip to content

Refactor DXT to MCPB (#34) #19

Refactor DXT to MCPB (#34)

Refactor DXT to MCPB (#34) #19

Workflow file for this run

name: Release on npm
on:
push:
branches:
- "main"
paths:
- package.json
permissions:
contents: write
pull-requests: read
id-token: write
jobs:
build_and_publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: Install dependencies
run: npm install
- name: Build
run: |
npm run clean
npm run build
- id: publish
name: Publish to NPM
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
dry-run: false
provenance: true
access: public
- name: Post-publish
if: steps.publish.outputs.type != 'none'
run: |
echo "Published ${{ steps.publish.outputs.type }} version: ${{ steps.publish.outputs.version }}"
- name: Publish skipped
if: steps.publish.outputs.type == 'none'
run: |
echo "Version in package.json has not changed. Skipping."
exit 0
- name: Configure changelog
if: steps.publish.outputs.type != 'none'
run: |
echo '{"categories": [], "template": "## Commits:\n\n${{ '${{UNCATEGORIZED}}' }}", "pr_template": ${{ '"- ${{MERGE_SHA}} ${{TITLE}}"' }} }' > changelog_config.json
echo "last_tag=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
echo "curr_commit=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Generate changelog
if: steps.publish.outputs.type != 'none'
id: github_release
uses: mikepenz/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
fromTag: "${{ env.last_tag }}"
toTag: ${{ github.ref }}
commitMode: true
configuration: changelog_config.json
- name: Create release
if: steps.publish.outputs.type != 'none'
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.publish.outputs.version }}
release_name: v${{ steps.publish.outputs.version }}
commitish: ${{ github.ref }}
body: ${{ steps.github_release.outputs.changelog }}
draft: false
prerelease: false
- name: Build .mcpb file
if: steps.publish.outputs.type != 'none'
run: npm run package:mcpb
- name: Upload .mcpb to GitHub release
if: steps.publish.outputs.type != 'none'
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ steps.publish.outputs.version }}
files: |
genesys-cloud-mcp-server.mcpb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}