-
Notifications
You must be signed in to change notification settings - Fork 17
73 lines (56 loc) · 1.51 KB
/
javascript.yml
File metadata and controls
73 lines (56 loc) · 1.51 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
62
63
64
65
66
67
68
69
70
71
72
73
name: Javascript Tests
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
release:
types:
- published
permissions:
contents: read
id-token: write
jobs:
test:
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, windows-latest, macos-latest]
node-version: ["v22", "v24"]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup node
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm ci
- name: Test
run: npm test
publish:
runs-on: ubuntu-latest
if: (github.event_name == 'release' && github.event.action == 'published') || github.event_name == 'workflow_dispatch'
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup node
uses: actions/setup-node@v6
with:
node-version: 24
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- name: Test
run: npm run test
- name: Copy javascript readme
run: cp javascript/README.md README.md # npm uses the root README for the package page
- name: List config
run: |
npm --version
node --version
npm config list -l
- name: Publish to npm
run: NODE_AUTH_TOKEN="" npm publish --access public --provenance