Skip to content

NPM Publish

NPM Publish #15

Workflow file for this run

name: "NPM Publish"
on:
release:
types: [created]
jobs:
build:
name: Build
runs-on: ubuntu-latest
services:
mongo:
image: mongo:6.0
options: >-
--health-cmd mongosh
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 27017:27017
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.org/
# Skip post-install scripts here, as a malicious
# script could steal NODE_AUTH_TOKEN.
- name: Install NPM dependencies
run: npm install --ignore-scripts
- name: Run linting
run: npm run lint
- name: Run tests
run: npm run test-ci
publish-npm:
name: NPM Publish
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.org/
# Skip post-install scripts here, as a malicious
# script could steal NODE_AUTH_TOKEN.
- name: Install NPM dependencies
run: npm install --ignore-scripts --production
- name: Run NPM publish
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN_SYNATIC}}