Skip to content

publish #bug2

publish #bug2 #27

Workflow file for this run

name: Publish
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up PNPM
uses: pnpm/action-setup@v2
with:
version: 8.x
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 16.x
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Lint
run: pnpm run lint
- name: Build project
run: pnpm run build
- name: Check for changes
id: changes
run: |
echo "::set-output name=changes::$(git diff --name-only ${{ github.sha }} ${{ github.sha }}^)"
shell: bash
- name: Publish on npm
if: steps.changes.outputs.changes != ''
run: pnpm publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}