Skip to main content
EVOKORE// WORKFLOWS / reusable-release.yml
EVOKORE-MCPworkflow · 33 lines

.github/workflows/reusable-release.yml

CI / automation

View on GitHub →
# REFERENCE-ONLY: GitHub Actions secrets referenced below are illustrative.
# Do not inject real credentials. See your CI/CD provider for proper secret management.
name: Reusable Release
on:
  workflow_call:
    inputs:
      version:
        type: string
        required: true
    secrets:
      NPM_TOKEN:
        required: false
jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '20'
          cache: 'npm'
          registry-url: 'https://registry.npmjs.org'
      - run: npm ci
      - run: npm run build
      - name: Publish to npm
        if: ${{ secrets.NPM_TOKEN != '' }}
        run: npm publish --access public
        env:
          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
      - name: Skip npm publish (no token)
        if: ${{ secrets.NPM_TOKEN == '' }}
        run: echo "NPM_TOKEN not set -- skipping npm publish"