-
Notifications
You must be signed in to change notification settings - Fork 124
61 lines (58 loc) · 2.1 KB
/
manual_publish_to_npm.yaml
File metadata and controls
61 lines (58 loc) · 2.1 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Publish to NPM
on:
workflow_dispatch:
inputs:
ref:
description: Git ref to publish (branch, tag, or commit SHA)
required: true
type: string
tag:
description: NPM dist-tag
required: true
type: choice
default: latest
options:
- latest
- beta
permissions:
id-token: write # Required for OIDC
contents: read
jobs:
publish_to_npm:
name: Publish to NPM
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
ref: ${{ inputs.ref }}
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version-file: .nvmrc
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
cache-dependency-path: 'package-lock.json'
- name: Update npm
run: npm install -g npm@latest
- name: Install dependencies
run: |
npm ci --force
- name: Check version consistency and bump pre-release version (beta only)
if: ${{ inputs.tag == 'beta' }}
run: node ./.github/scripts/before-beta-release.js
- name: Build web widgets
working-directory: src/web
run: |
npm ci --force
npm run build
- name: Build module
run: npm run build
- name: Upload source maps to Sentry
if: ${{ inputs.tag == 'latest' }}
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: |
npx sentry-cli sourcemaps inject ./dist
npx sentry-cli sourcemaps upload --release "$(jq -r '.version' package.json)" ./dist
- name: Publish to NPM
run: npm publish --tag ${{ inputs.tag }}