add publish workflow

This commit is contained in:
2023-11-15 18:46:56 +01:00
parent 2ef2f77a59
commit 7b1dd7e42b

29
.github/workflows/publish.yml vendored Normal file
View File

@@ -0,0 +1,29 @@
name: Publish to NPM
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --no-frozen-lockfile
- name: Build lib
run: pnpm run build
- uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_PUBLISH_TOKEN }}
access: 'public'