Skip to content

Publish Package to npmjs #19

Publish Package to npmjs

Publish Package to npmjs #19

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@v3
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: 'https://registry.npmjs.org'
- name: Publish CLI to npm
if: ${{ github.event.inputs.workspace_name == "cli" }}

Check failure on line 34 in .github/workflows/publish_npm.yml

View workflow run for this annotation

GitHub Actions / Publish Package to npmjs

Invalid workflow file

The workflow is not valid. .github/workflows/publish_npm.yml (Line: 34, Col: 11): Unexpected symbol: '"cli"'. Located at position 39 within expression: github.event.inputs.workspace_name == "cli" .github/workflows/publish_npm.yml (Line: 41, Col: 11): Unexpected symbol: '"detector"'. Located at position 40 within expression: github.event.inputs.workspace_name == "detector"
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