Skip to content

Publish NGX Grid Core #14

Publish NGX Grid Core

Publish NGX Grid Core #14

name: Publish NGX Grid Core
on:
workflow_dispatch:
workflow_run:
workflows: ["Build Ngx Grid Core"]
types: [completed]
branches:
- main
jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- name: Download Ngx Grid Artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: build-ngx-grid-core.yml
workflow_conclusion: success
name: ngx-grid-core
branch: main
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Publish to NPM
run: |
curVersion=$(jq -r .version ./package.json)
prevVersion=$(cat ./previous_package_version)
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ./.npmrc
if [ "$curVersion" != "$prevVersion" ]; then
rm previous_package_version
npm publish --access public
else
echo "Versions didn't change. No new version to publish."
fi
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}