Skip to content

Publish Package to npmjs #27

Publish Package to npmjs

Publish Package to npmjs #27

Workflow file for this run

name: Publish Package to npmjs
on:
workflow_dispatch:
inputs:
workspace_name:
description: 'Which workspace you want to deploy (cli, detector)'
required: true
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set Environment Variables
uses: tw3lveparsecs/[email protected]
with:
envFilePath: ./envvars.for.actions
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: 'https://registry.npmjs.org'
- name: Publish CLI to npm
if: ${{ github.event.inputs.workspace_name == 'cli' }}
run: |
npm i --workspaces
npm run compile --workspaces
npm publish --workspace=cli --provenance --access public
- name: Publish Detector to npm
if: ${{ github.event.inputs.workspace_name == 'detector'}}
run: |
npm i --workspaces
npm run compile --workspaces
npm publish --workspace=detector --provenance --access public