-
Notifications
You must be signed in to change notification settings - Fork 29
43 lines (42 loc) · 1.31 KB
/
publish.yml
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
39
40
41
42
43
name: Publish release
on:
# Runs whenever a new release is created in GitHub
release:
types: [ created ]
jobs:
# Publish job
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
strategy:
matrix:
node-version: [ 20 ]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.target_commitish }}
- name: Validate and extract release information
id: release
uses: manovotny/github-releases-for-automated-package-publishing-action@v2.0.1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
always-auth: true
cache: 'npm'
- run: npm ci
- name: Publish latest version
if: steps.release.outputs.tag == ''
run: npm publish --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish next version
if: steps.release.outputs.tag != ''
run: npm publish --provenance --tag next
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}