-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (31 loc) · 916 Bytes
/
npm-publish.yml
File metadata and controls
38 lines (31 loc) · 916 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
33
34
35
36
37
38
name: Publish to npm
on:
push:
tags:
- 'v*' # Trigger on version tags (v0.8.0, v1.0.0, etc.)
workflow_dispatch: # Manual trigger
jobs:
publish:
name: Publish to npm
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # Required for provenance
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- name: Create backups directory
run: mkdir -p backups
- name: Publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# prepublishOnly hook runs build and test automatically
# Provenance is signed automatically via id-token: write