-
-
Notifications
You must be signed in to change notification settings - Fork 412
101 lines (100 loc) · 2.98 KB
/
publish.yml
File metadata and controls
101 lines (100 loc) · 2.98 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Release
on:
push:
branches:
- master
- next
- next-major
- beta
- '[0-9]+.x'
- '[0-9]+.[0-9]+.x'
jobs:
publish:
name: Publish
runs-on: ubuntu-24.04
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
environment:
name: npm
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install dependencies
run: |
npm ci
sudo apt-get install xvfb
- name: Build
run: npm run build:release
- name: Validate code style
run: npm run validate
- name: Validate generated typescript definitions
run: |
npx tsc -p tsconfig.esm-check.json
npx tsc -p tsconfig.umd-check.json
- name: Chrome and Firefox tests
run: xvfb-run --auto-servernum npm run test -- --browsers ChromeSwiftShader,Firefox
- name: Archive test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: Utilities/TestResults/Test-Report.html
retention-days: 15
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# No need to set NPM_TOKEN because of OIDC
NPM_CONFIG_PROVENANCE: true
run: |
git config --global user.name "Github Actions"
git config --global user.email "sebastien.jourdain@kitware.com"
npm run semantic-release
deploy_docs:
if: github.ref == 'refs/heads/master'
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 22
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build:release
- name: Generate API docs
run: npm run docs:generate-api
- name: Generate docs examples
run: npm run docs:generate-examples
- name: Generate docs sidebar
run: npm run docs:generate-sidebar
- name: Generate docs gallery
run: npm run docs:generate-gallery
- name: Build docs
run: npm run docs:build
- name: Build docs examples
run: npm run docs:build-examples
- name: Upload docs as a Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./Documentation/.vitepress/dist/
- name: Deploy docs
uses: actions/deploy-pages@v4