-
Notifications
You must be signed in to change notification settings - Fork 30
41 lines (40 loc) · 1.38 KB
/
Copy pathpublish.yml
File metadata and controls
41 lines (40 loc) · 1.38 KB
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
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
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
ref: ${{ github.event.release.target_commitish }}
- name: Validate and extract release information
id: release
uses: manovotny/github-releases-for-automated-package-publishing-action@f8f252288da9babb174750562ce48fa5e5df70f5 # v2.0.1
- name: Use Node.js 24
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
node-version: 24
registry-url: 'https://registry.npmjs.org'
always-auth: true
# Never trust the cache for release builds!
cache: ''
- 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 }}