MCP Scholarly Server

name: Publish Package on: push: branches: [ main ] workflow_dispatch: permissions: contents: write pull-requests: write jobs: publish: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '18.x' registry-url: 'https://registry.npmjs.org' - name: Install dependencies run: npm ci - name: Conventional Changelog Action id: changelog uses: TriPSs/conventional-changelog-action@v6 with: github-token: ${{ secrets.GITHUB_TOKEN }} git-message: 'chore(release): {version}' preset: 'conventionalcommits' tag-prefix: 'v' output-file: 'CHANGELOG.md' skip-version-file: false skip-commit: false - name: Update version in package.json if: steps.changelog.outputs.skipped == 'false' run: | npm version ${{ steps.changelog.outputs.version }} --no-git-tag-version - name: Build run: npm run build - name: Create Release if: steps.changelog.outputs.skipped == 'false' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | gh release create v${{ steps.changelog.outputs.version }} \ --title "Release v${{ steps.changelog.outputs.version }}" \ --notes "${{ steps.changelog.outputs.clean_changelog }}" - name: Publish to NPM if: steps.changelog.outputs.skipped == 'false' run: npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Push changes if: steps.changelog.outputs.skipped == 'false' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | git config --global user.name 'github-actions[bot]' git config --global user.email 'github-actions[bot]@users.noreply.github.com' git add package.json CHANGELOG.md git commit -m "chore(release): v${{ steps.changelog.outputs.version }}" git push "https://$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git" HEAD:main