Skip to content

make example esm

make example esm #9

Workflow file for this run

name: Publish Package to npmjs
on:
release:
types: [published]
push:
branches: [ main ]
workflow_dispatch:
permissions:
contents: write
actions: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
- run: |
sudo apt install jq curl -y
pv=$(jq -r .version package.json)
rv=$(curl -s https://registry.npmjs.org/$(jq -r .name package.json) | jq -r '."dist-tags".latest')
[ "$pv" = "$rv" ] && exit 0
npm ci
npm run build
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}