Skip to content

Commit 1170891

Browse files
changes
1 parent 11e8d8f commit 1170891

File tree

4 files changed

+79
-169
lines changed

4 files changed

+79
-169
lines changed

.github/workflows/build.yml

Lines changed: 63 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,28 @@ on:
66

77
name: Build
88

9-
permissions:
10-
contents: write
11-
pull-requests: write
12-
id-token: write
13-
149
jobs:
15-
host_builds:
10+
host_tests:
1611
strategy:
1712
matrix:
1813
os: [macos-latest, windows-2019]
14+
fail-fast: false
1915
runs-on: ${{ matrix.os }}
2016
steps:
2117
- uses: actions/checkout@v4
2218

23-
- name: Build ${{ matrix.os }} Prebuild
24-
run: npm i --ignore-scripts && npm run install-zstd && npm run compile
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version: 16.20.1
22+
cache: "npm"
23+
registry-url: "https://registry.npmjs.org"
24+
25+
- name: Install zstd
26+
run: npm run install-zstd
27+
shell: bash
28+
29+
- name: install dependencies and compile
30+
run: npm install --loglevel verbose
2531
shell: bash
2632

2733
- id: upload
@@ -34,16 +40,19 @@ jobs:
3440
retention-days: 1
3541
compression-level: 0
3642

37-
container_builds:
38-
outputs:
39-
artifact_id: ${{ steps.upload.outputs.artifact-id }}
43+
container_tests_glibc:
4044
runs-on: ubuntu-latest
4145
strategy:
4246
matrix:
4347
linux_arch: [s390x, arm64, amd64]
48+
fail-fast: false
4449
steps:
4550
- uses: actions/checkout@v4
4651

52+
- uses: actions/setup-node@v4
53+
with:
54+
node-version: ${{ matrix.node }}
55+
4756
- name: Set up QEMU
4857
uses: docker/setup-qemu-action@v3
4958

@@ -56,6 +65,8 @@ jobs:
5665
docker buildx build \
5766
--platform linux/${{ matrix.linux_arch }} \
5867
--build-arg="NODE_ARCH=${{ matrix.linux_arch == 'amd64' && 'x64' || matrix.linux_arch }}" \
68+
--build-arg="NODE_VERSION=16.20.1" \
69+
--build-arg="UBUNTU_VERSION=${{ steps.get_nodejs_version.outputs.ubuntu_version }}" \
5970
--output type=local,dest=./prebuilds,platform-split=false \
6071
-f ./.github/docker/Dockerfile.glibc \
6172
.
@@ -64,7 +75,47 @@ jobs:
6475
name: Upload prebuild
6576
uses: actions/upload-artifact@v4
6677
with:
67-
name: build-linux-${{ matrix.linux_arch }}
78+
name: build-linux-glibc-${{ matrix.linux_arch }}
79+
path: prebuilds/
80+
if-no-files-found: "error"
81+
retention-days: 1
82+
compression-level: 0
83+
84+
container_tests_musl:
85+
runs-on: ubuntu-latest
86+
strategy:
87+
matrix:
88+
linux_arch: [amd64, arm64]
89+
fail-fast: false
90+
steps:
91+
- uses: actions/checkout@v4
92+
93+
- uses: actions/setup-node@v4
94+
with:
95+
node-version: ${{ matrix.node }}
96+
97+
- name: Set up QEMU
98+
uses: docker/setup-qemu-action@v3
99+
100+
- name: Set up Docker Buildx
101+
uses: docker/setup-buildx-action@v3
102+
103+
- name: Run Buildx
104+
run: |
105+
docker buildx create --name builder --bootstrap --use
106+
docker --debug buildx build --progress=plain --no-cache \
107+
--platform linux/${{ matrix.linux_arch }} \
108+
--build-arg="PLATFORM=${{ matrix.linux_arch == 'arm64' && 'arm64v8' || matrix.linux_arch }}" \
109+
--build-arg="NODE_VERSION=16.20.1" \
110+
--output type=local,dest=./prebuilds,platform-split=false \
111+
-f ./.github/docker/Dockerfile.musl \
112+
.
113+
114+
- id: upload
115+
name: Upload prebuild
116+
uses: actions/upload-artifact@v4
117+
with:
118+
name: build-linux-musl-${{ matrix.linux_arch }}
68119
path: prebuilds/
69120
if-no-files-found: "error"
70121
retention-days: 1

etc/install-zstd.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ clean_deps() {
88
download_zstd() {
99
rm -rf deps
1010
mkdir -p deps/zstd
11+
ZSTD_VERSION=$(cat package.json | jq -r '.zstd_version')
1112

12-
curl -L "https://github.com/facebook/zstd/releases/download/v1.5.6/zstd-1.5.6.tar.gz" \
13+
curl -L "https://github.com/facebook/zstd/releases/download/v$ZSTD_VERSION/zstd-$ZSTD_VERSION.tar.gz" \
1314
| tar -zxf - -C deps/zstd --strip-components 1
1415
}
1516

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,6 @@
4040
"napi_versions": [
4141
7
4242
]
43-
}
43+
},
44+
"zstd_version": "1.5.6"
4445
}

sbom.json

Lines changed: 12 additions & 155 deletions
Original file line numberDiff line numberDiff line change
@@ -1,175 +1,31 @@
11
{
22
"components": [
33
{
4-
"bom-ref": "pkg:cargo/[email protected]",
4+
"bom-ref": "pkg:github/facebook/[email protected]",
55
"externalReferences": [
66
{
77
"type": "distribution",
8-
"url": "https://crates.io/api/v1/crates/futures/0.3/download"
9-
},
10-
{
11-
"type": "vcs",
12-
"url": "https://github.com/rust-lang/futures-rs"
13-
},
14-
{
15-
"type": "website",
16-
"url": "https://crates.io/crates/futures/0.3"
17-
}
18-
],
19-
"licenses": [
20-
{
21-
"license": {
22-
"name": "Apache-2.0"
23-
}
24-
},
25-
{
26-
"license": {
27-
"name": "MIT"
28-
}
29-
}
30-
],
31-
"name": "futures",
32-
"purl": "pkg:cargo/[email protected]",
33-
"type": "library",
34-
"version": "0.3"
35-
},
36-
{
37-
"bom-ref": "pkg:cargo/[email protected]",
38-
"externalReferences": [
39-
{
40-
"type": "distribution",
41-
"url": "https://crates.io/api/v1/crates/napi/2.4.3/download"
42-
},
43-
{
44-
"type": "vcs",
45-
"url": "https://github.com/napi-rs/napi-rs"
46-
},
47-
{
48-
"type": "website",
49-
"url": "https://crates.io/crates/napi/2.4.3"
50-
}
51-
],
52-
"licenses": [
53-
{
54-
"license": {
55-
"name": "MIT"
56-
}
57-
}
58-
],
59-
"name": "napi",
60-
"purl": "pkg:cargo/[email protected]",
61-
"type": "library",
62-
"version": "2.4.3"
63-
},
64-
{
65-
"bom-ref": "pkg:cargo/[email protected]",
66-
"externalReferences": [
67-
{
68-
"type": "distribution",
69-
"url": "https://crates.io/api/v1/crates/napi-derive/2.4.1/download"
70-
},
71-
{
72-
"type": "vcs",
73-
"url": "https://github.com/napi-rs/napi-rs"
74-
},
75-
{
76-
"type": "website",
77-
"url": "https://crates.io/crates/napi-derive/2.4.1"
78-
}
79-
],
80-
"licenses": [
81-
{
82-
"license": {
83-
"name": "MIT"
84-
}
85-
}
86-
],
87-
"name": "napi-derive",
88-
"purl": "pkg:cargo/[email protected]",
89-
"type": "library",
90-
"version": "2.4.1"
91-
},
92-
{
93-
"bom-ref": "pkg:cargo/[email protected]",
94-
"externalReferences": [
95-
{
96-
"type": "distribution",
97-
"url": "https://crates.io/api/v1/crates/zstd/0.11/download"
98-
},
99-
{
100-
"type": "vcs",
101-
"url": "https://github.com/gyscos/zstd-rs"
8+
"url": "https://github.com/facebook/zstd/archive/refs/tags/1.5.6.tar.gz"
1029
},
10310
{
10411
"type": "website",
105-
"url": "https://crates.io/crates/zstd/0.11"
106-
}
107-
],
108-
"licenses": [
109-
{
110-
"license": {
111-
"name": "MIT"
112-
}
12+
"url": "https://github.com/facebook/zstd/tree/1.5.6"
11313
}
11414
],
15+
"group": "facebook",
11516
"name": "zstd",
116-
"purl": "pkg:cargo/[email protected]",
117-
"type": "library",
118-
"version": "0.11"
119-
},
120-
{
121-
"bom-ref": "pkg:cargo/[email protected]",
122-
"externalReferences": [
123-
{
124-
"type": "distribution",
125-
"url": "https://crates.io/api/v1/crates/zstd-sys/2.0.8/download"
126-
},
127-
{
128-
"type": "vcs",
129-
"url": "https://github.com/gyscos/zstd-rs"
130-
},
131-
{
132-
"type": "website",
133-
"url": "https://crates.io/crates/zstd-sys/2.0.8"
134-
}
135-
],
136-
"licenses": [
137-
{
138-
"license": {
139-
"name": "Apache-2.0"
140-
}
141-
},
142-
{
143-
"license": {
144-
"name": "MIT"
145-
}
146-
}
147-
],
148-
"name": "zstd-sys",
149-
"purl": "pkg:cargo/[email protected]",
17+
"purl": "pkg:github/facebook/[email protected]",
15018
"type": "library",
151-
"version": "2.0.8"
19+
"version": "1.5.6"
15220
}
15321
],
15422
"dependencies": [
15523
{
156-
"ref": "pkg:cargo/[email protected]"
157-
},
158-
{
159-
"ref": "pkg:cargo/[email protected]"
160-
},
161-
{
162-
"ref": "pkg:cargo/[email protected]"
163-
},
164-
{
165-
"ref": "pkg:cargo/[email protected]"
166-
},
167-
{
168-
"ref": "pkg:cargo/[email protected]"
24+
"ref": "pkg:github/facebook/[email protected]"
16925
}
17026
],
17127
"metadata": {
172-
"timestamp": "2024-05-01T21:03:39.164915+00:00",
28+
"timestamp": "2024-11-22T18:19:11.589830+00:00",
17329
"tools": [
17430
{
17531
"externalReferences": [
@@ -212,9 +68,10 @@
21268
}
21369
]
21470
},
215-
"serialNumber": "urn:uuid:a8980ce9-1205-4b26-bed3-a0ad798988a6",
71+
"serialNumber": "urn:uuid:09d58a28-c1dc-43da-ad85-67c806e16b87",
21672
"version": 1,
21773
"$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
21874
"bomFormat": "CycloneDX",
219-
"specVersion": "1.5"
220-
}
75+
"specVersion": "1.5",
76+
"vulnerabilities": []
77+
}

0 commit comments

Comments
 (0)