Skip to content

Commit 593d176

Browse files
Adding VersionStream for nodejs-23 (wolfi-dev#31024)
Co-authored-by: octo-sts[bot] <157150467+octo-sts@users.noreply.github.com>
1 parent 2113998 commit 593d176

File tree

1 file changed

+111
-0
lines changed

1 file changed

+111
-0
lines changed

nodejs-23.yaml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
package:
2+
name: nodejs-23
3+
version: 23.0.0
4+
epoch: 0
5+
description: "JavaScript runtime built on V8 engine"
6+
dependencies:
7+
provides:
8+
- nodejs=${{package.full-version}}
9+
copyright:
10+
- license: MIT
11+
resources:
12+
cpu: 33
13+
memory: 64Gi
14+
15+
environment:
16+
contents:
17+
packages:
18+
- brotli-dev
19+
- build-base
20+
- busybox
21+
- c-ares-dev
22+
- ca-certificates-bundle
23+
- icu-dev
24+
- libuv-dev
25+
- linux-headers
26+
- nghttp2-dev
27+
- openssl-dev
28+
- py3-jinja2
29+
- py3-setuptools
30+
- python3
31+
- samurai
32+
- wolfi-base
33+
- zlib-dev
34+
35+
pipeline:
36+
- uses: git-checkout
37+
with:
38+
repository: https://github.com/nodejs/node.git
39+
tag: v${{package.version}}
40+
expected-commit: 401f376d02372c8b96ce836a4f6860b574f27c42
41+
42+
- name: Configure and build
43+
runs: |
44+
# Add defines recommended in libuv readme.
45+
common_flags="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
46+
47+
# Compiling with O2 instead of Os increases binary size by ~10%
48+
# (53.1 MiB -> 58.6 MiB), but also increases performance by ~20%
49+
# according to v8/web-tooling-benchmark. Node.js is quite huge anyway;
50+
# there are better options for size constrained environments.
51+
export CFLAGS="${CFLAGS/-Os/-O2} $common_flags"
52+
export CXXFLAGS="${CXXFLAGS/-Os/-O2} $common_flags"
53+
export CPPFLAGS="${CPPFLAGS/-Os/-O2} $common_flags"
54+
python3 configure.py --prefix=/usr \
55+
--shared-brotli \
56+
--shared-zlib \
57+
--shared-openssl \
58+
--shared-cares \
59+
--shared-nghttp2 \
60+
--shared-libuv \
61+
--ninja \
62+
--openssl-use-def-ca-store \
63+
--with-icu-default-data-dir=$(icu-config --icudatadir) \
64+
--with-intl=system-icu \
65+
--openssl-conf-name=openssl_conf \
66+
--without-corepack
67+
68+
make BUILDTYPE=Release -j$(nproc)
69+
70+
- uses: autoconf/make
71+
72+
- uses: autoconf/make-install
73+
74+
- runs: |
75+
make DESTDIR="$${{targets.destdir}}" install
76+
77+
- uses: strip
78+
79+
# Get rid of the bundled npm, we don't need it.
80+
- runs: |
81+
rm -rf "${{targets.destdir}}"/usr/lib/node_modules
82+
rm "${{targets.destdir}}"/usr/bin/npm
83+
rm "${{targets.destdir}}"/usr/bin/npx
84+
85+
update:
86+
enabled: true
87+
github:
88+
identifier: nodejs/node
89+
strip-prefix: v
90+
use-tag: true
91+
tag-filter: v23.
92+
93+
test:
94+
pipeline:
95+
- name: Verify Node.js Installation
96+
runs: |
97+
node --version || exit 1
98+
node --help
99+
- name: Execute Basic JavaScript
100+
runs: |
101+
cat <<'EOF' > test.js
102+
console.log('Hello, World!');
103+
EOF
104+
node test.js | grep 'Hello, World!' || exit 1
105+
- name: Test International Number Formatting
106+
runs: |
107+
cat <<'EOF' > testIntl.js
108+
console.log(new Intl.NumberFormat('en-EN').format(1234.56));
109+
console.log(new Intl.NumberFormat('de-DE').format(1234.56));
110+
EOF
111+
node testIntl.js | grep '1,234.56' && node testIntl.js | grep '1.234,56' || exit 1

0 commit comments

Comments
 (0)