-
Notifications
You must be signed in to change notification settings - Fork 280
33 lines (32 loc) · 1.2 KB
/
release.yml
File metadata and controls
33 lines (32 loc) · 1.2 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
name: publish to npmjs
on:
release:
# it is simpler to have separate release.yml and prerelease.yml workflows,
# however, on npm you can only associate one workflow as trusted (or however
# it's called exactly) - so we need to combine both in one workflow, with
# the if conditions on the steps.
types: [released, prereleased]
jobs:
publish:
environment: npm
if: github.repository == 'sverweij/dependency-cruiser'
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 24.x
registry-url: https://registry.npmjs.org
# legacy peer deps because otherwise typescript-eslint hard-complains
# as it can't find a suitable typescript compiler (we're on 6 now,
# ts-eslint isn't yet)
- run: npm clean-install --legacy-peer-deps
- name: publish as latest
run: npm publish --provenance --access public
if: github.event.release.prerelease == false
- name: publish as beta
run: npm publish --provenance --access public --tag beta
if: github.event.release.prerelease == true