Skip to content

update action file

update action file #10

Workflow file for this run

name: Publish npm package
on:
push:
branches:
- main
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'
- name: Install pnpm
run: npm install -g pnpm
- name: Install dependencies
run: pnpm i
- name: Run tests
run: pnpm test
- name: Check if version changed
id: version_check
uses: EndBug/version-check@v2
with:
static-checking: localIsNew
- name: Publish to npm
if: steps.version_check.outputs.changed == 'true'
run: pnpm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}