Publish Package to npmjs #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 GitHub Actions / Publish Package to npmjsInvalid workflow file
|
||
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 | ||