Repository navigation
55 lines (44 loc) · 1.5 KB
/
Copy pathpublish.yml
File metadata and controls
55 lines (44 loc) · 1.5 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
name: Publish to npm
on:
push:
tags:
- 'v*'
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: '22'
registry-url: 'https://registry.npmjs.org'
# `npm ci` rather than `npm install`: a published package should be built
# from the exact dependency tree the lockfile pins, not from whatever the
# ranges resolve to on the day the tag is pushed.
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
# This job used to build and publish, and nothing else. CI runs the gates
# on every push to main, but nothing re-ran them for the commit a tag
# actually points at -- so a tag on an unverified commit would publish.
# The gates are cheap next to shipping a broken release.
- name: Unit tests
run: npm test
- name: Accessibility gate
run: npm run check:a11y
- name: Static CSS gate
run: npm run check:css
- name: Install Chromium for the browser gates
run: npx playwright install --with-deps chromium
- name: Rendered-page gate
run: npm run check:pages
- name: Keyboard-operability gate
run: npm run check:keyboard
- name: Publish to npm
run: npm publish --access public --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}