-
Notifications
You must be signed in to change notification settings - Fork 8
32 lines (26 loc) · 763 Bytes
/
Copy pathpublish.yml
File metadata and controls
32 lines (26 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: Publish to npm
on:
release:
types: [published]
permissions:
contents: read
id-token: write # required for npm provenance
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node 20
uses: actions/setup-node@v4
with:
node-version: 20.x
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm install
# `npm publish` runs `prepublishOnly` (lint + build) first.
# NPM_TOKEN must be an npm automation token so 2FA does not block CI.
- name: Publish to npm
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}