From 641fdda003cfb59d9265784b41d2ee786a77fb8a Mon Sep 17 00:00:00 2001 From: Ben Williams Date: Mon, 10 Aug 2026 12:56:40 -0700 Subject: [PATCH 1/2] Publish prebuilt binaries only --- .github/workflows/ci.yml | 8 ++++++++ README.md | 12 +++++++----- package.json | 7 +++++-- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb6cadc..26ee50b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -247,6 +247,14 @@ jobs: mkdir -p artifacts/package npm pack --ignore-scripts --pack-destination artifacts/package + - name: Verify package excludes native build sources + run: | + set -euo pipefail + if tar -tzf artifacts/package/*.tgz | grep -Eq '^package/(binding\.gyp|libopus/|src/)'; then + echo "Release package must contain only prebuilt native binaries." >&2 + exit 1 + fi + - name: Verify the packed module in native Alpine arm64 run: | set -euo pipefail diff --git a/README.md b/README.md index 1210cf3..0c3a36c 100644 --- a/README.md +++ b/README.md @@ -11,13 +11,13 @@ It exposes a small JavaScript API backed by N-API native bindings so you can enc **Key traits:** - **ESM-only**: the package uses native ES modules; you must `import` it (no `require()`). -- **Prebuilt binaries**: GitHub Actions publishes binaries for Linux, macOS, Windows (including musl) so install usually finishes without a compiler. +- **Prebuilt binaries**: GitHub Actions publishes binaries for Linux, macOS, Windows, and OpenBSD (including Linux musl), so installation never requires a compiler. - **Node 24+**: built against current Node headers and includes prebuilds for the active LTS line. - **Minimal surface**: exposes an `OpusEncoder` class with encode/decode helpers plus passthrough CTL access—ideal for bots, streaming services, or testing harnesses that want full control over buffers. Prebuilt binaries are provided for the platforms listed below; you do not need a system libopus installed. -If no prebuild is available for your target, npm will fall back to `node-gyp-build`, so you can still compile from source as long as a C/C++ toolchain is present. +This package is prebuild-only. An installation target without a matching prebuild is unsupported. --- @@ -301,17 +301,19 @@ try { ## Platform support -> ⚠ **Node.js 20.0.0 or newer is required.** +> ⚠ **Node.js 24.0.0 or newer is required.** Prebuilt binaries are provided for: | Operating System | Architectures | | ---------------- | ------------- | -| Linux | x64, arm64 | +| Linux (glibc) | x64, arm64 | +| Linux (musl) | x64, arm64 | | macOS | x64, arm64 | | Windows | x64 | +| OpenBSD | x64 | -If a prebuilt binary is not available for your platform, Node will attempt to build from source during installation; this requires a working C/C++ toolchain and build tools for your OS. +If a prebuilt binary is not available for your platform, the package cannot be used on that platform. --- diff --git a/package.json b/package.json index 9b9ef76..9deafaa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "libopus-node", - "version": "1.2.0", + "version": "1.3.0", "description": "libopus bindings for Node", "keywords": [ "binary", @@ -26,8 +26,11 @@ "import": "./dist/index.js" } }, + "files": [ + "dist", + "prebuilds" + ], "scripts": { - "install": "node-gyp-build", "build-native": "node-gyp-build", "build-package": "vp pack", "build": "vp run build-native && vp pack", From d2897241b921c80250c269decf3b07e8b98e0f50 Mon Sep 17 00:00:00 2001 From: Ben Williams Date: Mon, 10 Aug 2026 13:02:50 -0700 Subject: [PATCH 2/2] Format package manifest --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 9deafaa..61f4b17 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,10 @@ "type": "git", "url": "git+https://github.com/biw/libopus-node.git" }, + "files": [ + "dist", + "prebuilds" + ], "type": "module", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -26,10 +30,6 @@ "import": "./dist/index.js" } }, - "files": [ - "dist", - "prebuilds" - ], "scripts": { "build-native": "node-gyp-build", "build-package": "vp pack",