-
Notifications
You must be signed in to change notification settings - Fork 7
91 lines (77 loc) · 2.74 KB
/
build.yml
File metadata and controls
91 lines (77 loc) · 2.74 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
name: Build
on: [ pull_request ]
# We build distribution CSS and JS on both the active LTS and previous LTS Node.js versions,
# to ensure compatibility across a wider range of environments. Those versions are defined
# in package.json `devEngines` field and must match the versions defined in `env` section below.
#
# As package.json does not support comments, we document the version mapping here.
#
# `engines` field in package.json defines the minimum required Node.js version for running the package.
# We set it to the first released previous LTS version of Node.js. This means we allow users
# to run the package on this version and any later versions.
#
# "engines": {
# "node": ">=22.11.0"
# }
#
# `devEngines` field in package.json defines the Node.js versions used for development and building.
# We set both to the first released active and previous LTS versions of Node.js. We also set
# the npm version to the version of npm bundled with the first released active LTS Node.js version.
# This means we strictly require one of those versions for development and building.
#
# "devEngines": {
# "runtime": {
# "name": "node",
# "version": "^22.11.0 || ^24.11.0",
# "onFail": "error"
# },
# "packageManager": {
# "name": "npm",
# "version": "^11.6.1",
# "onFail": "error"
# }
# }
#
# Versions defined in `env` use major version numbers only to install the latest minor/patch.
env:
NODE_ACTIVE_LTS_VERSION: 24
NODE_PREVIOUS_LTS_VERSION: 22
NPM_VERSION: 11
jobs:
build_on_node_previous_lts:
name: Build distribution CSS and JS (Node Previous LTS)
runs-on: ubuntu-24.04
steps:
- name: Clone repository
uses: actions/checkout@v6
- name: Set up Node.js (${{ env.NODE_PREVIOUS_LTS_VERSION }})
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_PREVIOUS_LTS_VERSION }}
cache: npm
continue-on-error: true
- name: Install npm@${{ env.NPM_VERSION }}
run: npm install -g npm@${{ env.NPM_VERSION }}
- name: Print Node.js and npm version
run: node --version && npm --version
- name: Install
run: npm ci
- name: Build
run: npm run build
build_on_node_active_lts:
name: Build distribution CSS and JS (Node Active LTS)
runs-on: ubuntu-24.04
steps:
- name: Clone repository
uses: actions/checkout@v6
- name: Set up Node.js (${{ env.NODE_ACTIVE_LTS_VERSION }})
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_ACTIVE_LTS_VERSION }}
cache: npm
- name: Print Node.js and npm version
run: node --version && npm --version
- name: Install
run: npm ci
- name: Build
run: npm run build