Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@ on:
release:
types: [created]

permissions:
id-token: write
contents: read

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v7
- uses: actions/setup-node@v6
with:
node-version: 20
node-version: 24
registry-url: "https://registry.npmjs.org"

- run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
Expand All @@ -25,14 +29,19 @@ jobs:
npm run build-pack
node scripts/build-task.js

- name: Validate MCP package contents
run: npm run validate:package --workspace=@igniteui/mcp-server -- --expected-version "$VERSION"

- name: Define npm tag
run: |
if [[ ${VERSION} == *"alpha"* || ${VERSION} == *"beta"* || ${VERSION} == *"rc"* ]]; then echo "NPM_TAG=next"; else echo "NPM_TAG=latest"; fi >> $GITHUB_ENV
echo ${NPM_TAG}
if [[ ${VERSION} == *"alpha"* || ${VERSION} == *"beta"* || ${VERSION} == *"rc"* ]]; then
NPM_TAG=next
else
NPM_TAG=latest
fi
echo "NPM_TAG=$NPM_TAG" >> $GITHUB_ENV
echo "$NPM_TAG"

- name: Publish packages
# use npm run as yarn run changes the registry and publishes to https://registry.yarnpkg.com
run: npm run deploy ${NPM_TAG}
# define env variable for the specific run
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
Loading