Skip to content

Merge pull request #289 from MeasureAuthoringTool/fix-npm-publish #126

Merge pull request #289 from MeasureAuthoringTool/fix-npm-publish

Merge pull request #289 from MeasureAuthoringTool/fix-npm-publish #126

Workflow file for this run

name: npm-publish
on:
push:
branches:
- main
jobs:
npm-publish:
name: npm-publish
if: contains(github.event.pull_request.title || github.event.head_commit.message, 'Release')
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./react
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Install node dependencies
run: npm ci
- name: Audit dependencies for security vulnerabilities
run: npm audit --omit=dev
- name: Build the source code
run: npm run build
- name: Publish to npm
env: # More info about the environment variables in the README
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this as is, it's automatically generated
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --access public