Skip to content

Publish npm

Publish npm #7

Workflow file for this run

# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
name: Publish npm
on:
push:
tags:
- 'v*'
jobs:
publish-npm:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0 # Required by https://github.com/antfu/changelogithub
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: 'npm'
registry-url: https://registry.npmjs.org/
scope: '@gburning'
- name: Install dependencies
run: npm ci
- name: Generate changelog
run: npx changelogithub
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build package
run: npm run build
- name: Publish package
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}