Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
baileympearson committed Nov 22, 2024
1 parent 11e8d8f commit 1170891
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 169 deletions.
75 changes: 63 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,28 @@ on:

name: Build

permissions:
contents: write
pull-requests: write
id-token: write

jobs:
host_builds:
host_tests:
strategy:
matrix:
os: [macos-latest, windows-2019]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

- name: Build ${{ matrix.os }} Prebuild
run: npm i --ignore-scripts && npm run install-zstd && npm run compile
- uses: actions/setup-node@v4
with:
node-version: 16.20.1
cache: "npm"
registry-url: "https://registry.npmjs.org"

- name: Install zstd
run: npm run install-zstd
shell: bash

- name: install dependencies and compile
run: npm install --loglevel verbose
shell: bash

- id: upload
Expand All @@ -34,16 +40,19 @@ jobs:
retention-days: 1
compression-level: 0

container_builds:
outputs:
artifact_id: ${{ steps.upload.outputs.artifact-id }}
container_tests_glibc:
runs-on: ubuntu-latest
strategy:
matrix:
linux_arch: [s390x, arm64, amd64]
fail-fast: false
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

Expand All @@ -56,6 +65,8 @@ jobs:
docker buildx build \
--platform linux/${{ matrix.linux_arch }} \
--build-arg="NODE_ARCH=${{ matrix.linux_arch == 'amd64' && 'x64' || matrix.linux_arch }}" \
--build-arg="NODE_VERSION=16.20.1" \
--build-arg="UBUNTU_VERSION=${{ steps.get_nodejs_version.outputs.ubuntu_version }}" \
--output type=local,dest=./prebuilds,platform-split=false \
-f ./.github/docker/Dockerfile.glibc \
.
Expand All @@ -64,7 +75,47 @@ jobs:
name: Upload prebuild
uses: actions/upload-artifact@v4
with:
name: build-linux-${{ matrix.linux_arch }}
name: build-linux-glibc-${{ matrix.linux_arch }}
path: prebuilds/
if-no-files-found: "error"
retention-days: 1
compression-level: 0

container_tests_musl:
runs-on: ubuntu-latest
strategy:
matrix:
linux_arch: [amd64, arm64]
fail-fast: false
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Run Buildx
run: |
docker buildx create --name builder --bootstrap --use
docker --debug buildx build --progress=plain --no-cache \
--platform linux/${{ matrix.linux_arch }} \
--build-arg="PLATFORM=${{ matrix.linux_arch == 'arm64' && 'arm64v8' || matrix.linux_arch }}" \
--build-arg="NODE_VERSION=16.20.1" \
--output type=local,dest=./prebuilds,platform-split=false \
-f ./.github/docker/Dockerfile.musl \
.
- id: upload
name: Upload prebuild
uses: actions/upload-artifact@v4
with:
name: build-linux-musl-${{ matrix.linux_arch }}
path: prebuilds/
if-no-files-found: "error"
retention-days: 1
Expand Down
3 changes: 2 additions & 1 deletion etc/install-zstd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ clean_deps() {
download_zstd() {
rm -rf deps
mkdir -p deps/zstd
ZSTD_VERSION=$(cat package.json | jq -r '.zstd_version')

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

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@
"napi_versions": [
7
]
}
},
"zstd_version": "1.5.6"
}
167 changes: 12 additions & 155 deletions sbom.json
Original file line number Diff line number Diff line change
@@ -1,175 +1,31 @@
{
"components": [
{
"bom-ref": "pkg:cargo/futures@0.3",
"bom-ref": "pkg:github/facebook/zstd@1.5.6",
"externalReferences": [
{
"type": "distribution",
"url": "https://crates.io/api/v1/crates/futures/0.3/download"
},
{
"type": "vcs",
"url": "https://github.com/rust-lang/futures-rs"
},
{
"type": "website",
"url": "https://crates.io/crates/futures/0.3"
}
],
"licenses": [
{
"license": {
"name": "Apache-2.0"
}
},
{
"license": {
"name": "MIT"
}
}
],
"name": "futures",
"purl": "pkg:cargo/futures@0.3",
"type": "library",
"version": "0.3"
},
{
"bom-ref": "pkg:cargo/napi@2.4.3",
"externalReferences": [
{
"type": "distribution",
"url": "https://crates.io/api/v1/crates/napi/2.4.3/download"
},
{
"type": "vcs",
"url": "https://github.com/napi-rs/napi-rs"
},
{
"type": "website",
"url": "https://crates.io/crates/napi/2.4.3"
}
],
"licenses": [
{
"license": {
"name": "MIT"
}
}
],
"name": "napi",
"purl": "pkg:cargo/napi@2.4.3",
"type": "library",
"version": "2.4.3"
},
{
"bom-ref": "pkg:cargo/napi-derive@2.4.1",
"externalReferences": [
{
"type": "distribution",
"url": "https://crates.io/api/v1/crates/napi-derive/2.4.1/download"
},
{
"type": "vcs",
"url": "https://github.com/napi-rs/napi-rs"
},
{
"type": "website",
"url": "https://crates.io/crates/napi-derive/2.4.1"
}
],
"licenses": [
{
"license": {
"name": "MIT"
}
}
],
"name": "napi-derive",
"purl": "pkg:cargo/napi-derive@2.4.1",
"type": "library",
"version": "2.4.1"
},
{
"bom-ref": "pkg:cargo/zstd@0.11",
"externalReferences": [
{
"type": "distribution",
"url": "https://crates.io/api/v1/crates/zstd/0.11/download"
},
{
"type": "vcs",
"url": "https://github.com/gyscos/zstd-rs"
"url": "https://github.com/facebook/zstd/archive/refs/tags/1.5.6.tar.gz"
},
{
"type": "website",
"url": "https://crates.io/crates/zstd/0.11"
}
],
"licenses": [
{
"license": {
"name": "MIT"
}
"url": "https://github.com/facebook/zstd/tree/1.5.6"
}
],
"group": "facebook",
"name": "zstd",
"purl": "pkg:cargo/zstd@0.11",
"type": "library",
"version": "0.11"
},
{
"bom-ref": "pkg:cargo/zstd-sys@2.0.8",
"externalReferences": [
{
"type": "distribution",
"url": "https://crates.io/api/v1/crates/zstd-sys/2.0.8/download"
},
{
"type": "vcs",
"url": "https://github.com/gyscos/zstd-rs"
},
{
"type": "website",
"url": "https://crates.io/crates/zstd-sys/2.0.8"
}
],
"licenses": [
{
"license": {
"name": "Apache-2.0"
}
},
{
"license": {
"name": "MIT"
}
}
],
"name": "zstd-sys",
"purl": "pkg:cargo/zstd-sys@2.0.8",
"purl": "pkg:github/facebook/zstd@1.5.6",
"type": "library",
"version": "2.0.8"
"version": "1.5.6"
}
],
"dependencies": [
{
"ref": "pkg:cargo/futures@0.3"
},
{
"ref": "pkg:cargo/napi-derive@2.4.1"
},
{
"ref": "pkg:cargo/napi@2.4.3"
},
{
"ref": "pkg:cargo/zstd-sys@2.0.8"
},
{
"ref": "pkg:cargo/zstd@0.11"
"ref": "pkg:github/facebook/zstd@1.5.6"
}
],
"metadata": {
"timestamp": "2024-05-01T21:03:39.164915+00:00",
"timestamp": "2024-11-22T18:19:11.589830+00:00",
"tools": [
{
"externalReferences": [
Expand Down Expand Up @@ -212,9 +68,10 @@
}
]
},
"serialNumber": "urn:uuid:a8980ce9-1205-4b26-bed3-a0ad798988a6",
"serialNumber": "urn:uuid:09d58a28-c1dc-43da-ad85-67c806e16b87",
"version": 1,
"$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
"bomFormat": "CycloneDX",
"specVersion": "1.5"
}
"specVersion": "1.5",
"vulnerabilities": []
}

0 comments on commit 1170891

Please sign in to comment.