-
-
Notifications
You must be signed in to change notification settings - Fork 34
28 lines (28 loc) · 792 Bytes
/
Copy pathrelease.yaml
File metadata and controls
28 lines (28 loc) · 792 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
name: Publish Package to npmjs
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 'lts/*'
registry-url: 'https://registry.npmjs.org'
- run: npm install
- name: Publish to npm
run: |
if node -e "process.exit(/-/.test(require('./package.json').version) ? 0 : 1)"; then
echo "Prerelease version; publishing with dist-tag: next"
npm publish --provenance --access public --tag next
else
npm publish --provenance --access public
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}