Publish NPM Package #50
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish NPM Package | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| channel: | |
| required: true | |
| type: choice | |
| description: NPM tag to publish the package to | |
| options: | |
| - oldversion | |
| - alpha | |
| - beta | |
| - latest | |
| permissions: | |
| id-token: write | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./mcp-server | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| # PR context: build from PR head; workflow_dispatch: build from triggered ref (e.g. release/x.y.z) | |
| ref: ${{ github.event.pull_request.head.sha || github.ref }} | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "24.x" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Update npm to support Trusted Publishing | |
| run: npm install -g npm@latest | |
| - run: npm ci | |
| - name: Publish to NPM | |
| run: | | |
| git config user.name "Currents NPM Bot" | |
| git config user.email "npm@currents.dev" | |
| npm run publish:mcp -- -- --tag ${{ github.event.inputs.channel }} | |