Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Publish tagged versions to NPM (#10) #6

Publish tagged versions to NPM (#10)

Publish tagged versions to NPM (#10) #6

Workflow file for this run

name: Publish to NPM
on:
push:
tags: ["v[0-9]+.[0-9]+.[0-9]+"]
permissions:
contents: read
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
clean: true
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "npm"
- run: |
VER=`echo "${{ github.ref }}" | sed -e 's/refs\/tags\/v//'`
sed -i "s/^ *\"version\": \".*\", *$/ \"version\": \"$VER\",/" package.json
- run: npm ci
- run: npm run build
- run: |
rm -Rf dist/src/
cp package.json README.md LICENSE dist/
- uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
package: "dist"
access: "public"