-
Notifications
You must be signed in to change notification settings - Fork 880
35 lines (31 loc) · 1.03 KB
/
Copy pathpublish.yml
File metadata and controls
35 lines (31 loc) · 1.03 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
name: publish to npmjs
on:
release:
types: [prereleased, released]
jobs:
build-and-publish:
# prevents this action from running on forks
if: github.repository == 'chimurai/http-proxy-middleware'
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # Required for OIDC
steps:
- uses: actions/checkout@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@v6
with:
node-version: '24.x'
registry-url: 'https://registry.npmjs.org'
# Ensure npm 11.5.1 or later is installed
- name: Update npm
run: npm install -g npm@latest
- name: Install Dependencies
run: yarn install --frozen-lockfile --ignore-scripts
- name: Publish to NPM (beta)
if: 'github.event.release.prerelease'
run: npm stage publish --access public --tag v3-beta
- name: Publish to NPM (stable)
if: '!github.event.release.prerelease'
run: npm stage publish --access public --tag v3-latest