Skip to content

add build step

add build step #3

Workflow file for this run

name: Publish to NPM
on:
push:
tags:
- 'v*' # This will run the workflow when you push a tag with a version format, like v1.0.0
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: Build package
uses: actions/setup-node@v4
with:
node-version: 20
run: npm install

Check failure on line 20 in .github/workflows/publish.yaml

View workflow run for this annotation

GitHub Actions / Publish to NPM

Invalid workflow file

The workflow is not valid. .github/workflows/publish.yaml (Line: 20, Col: 9): Unexpected value 'run' .github/workflows/publish.yaml (Line: 21, Col: 9): 'run' is already defined
run: npm build
- name: Publish to NPM
run: |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
if grep -qE "_authToken=.{1,}" .npmrc; then
npm publish
else
echo "Failed to create .npmrc file" && exit 1
fi
env:
NPM_TOKEN: ${{ secrets.NPM_AUTOMATION_TOKEN }}