Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 34 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ jobs:
- host: ubuntu-latest
target: aarch64-unknown-linux-gnu
build: npm run build -- --target aarch64-unknown-linux-gnu --use-napi-cross
# Linux musl (Alpine and other musl-based images). napi-rs uses
# cargo-zigbuild under the hood; `-x` tells `napi build` to drive it.
- host: ubuntu-latest
target: x86_64-unknown-linux-musl
build: npm run build -- --target x86_64-unknown-linux-musl -x
- host: ubuntu-latest
target: aarch64-unknown-linux-musl
build: npm run build -- --target aarch64-unknown-linux-musl -x
# Windows
- host: windows-latest
target: x86_64-pc-windows-msvc
Expand Down Expand Up @@ -93,6 +101,22 @@ jobs:
target/
key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.host }}

# musl builds go through cargo-zigbuild (napi-rs's `-x` flag). Zig
# supplies the cross-libc; cargo-zigbuild wires it into rustc.
- name: Setup Zig (musl targets only)
if: contains(matrix.settings.target, 'musl')
uses: mlugg/setup-zig@v2
with:
version: 0.14.1

- name: Install cargo-zigbuild (musl targets only)
if: contains(matrix.settings.target, 'musl')
uses: taiki-e/install-action@v2
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tool: cargo-zigbuild

- name: Install Dependencies
run: npm ci

Expand Down Expand Up @@ -166,11 +190,16 @@ jobs:
run: npm config set provenance true

- name: Publish per-platform packages and update optionalDependencies
# All seven per-platform packages now have npm trusted publishing
# configured, so OIDC alone authenticates and NODE_AUTH_TOKEN is
# cleared to avoid setup-node's default GITHUB_TOKEN leaking
# in and breaking the provenance flow.
run: NODE_AUTH_TOKEN="" npx napi prepublish -t npm --no-gh-release
# Two new per-platform packages (config-disassembler-linux-x64-musl,
# config-disassembler-linux-arm64-musl) are net-new on npm and have
# no trusted-publisher configured yet (npm requires the package to
# exist before trusted publishing can be set up). Bootstrap via
# NPM_TOKEN for this release; once the two musl packages exist and
# trusted publishing is configured for them on npmjs.com, this can
# revert to `NODE_AUTH_TOKEN=""` to match the main publish below.
run: npx napi prepublish -t npm --no-gh-release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish main package
# Same trusted-publishing pattern as the per-platform packages
Expand Down
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
[![License](https://img.shields.io/badge/License-MIT-yellow.svg)](https://raw.githubusercontent.com/mcarvin8/config-disassembler-node/main/LICENSE.md)
[![Downloads/week](https://img.shields.io/npm/dw/config-disassembler.svg)](https://npmjs.org/package/config-disassembler)

Node.js bindings for the Rust [`config-disassembler`](https://crates.io/crates/config-disassembler) crate via [napi-rs](https://napi.rs).
Node.js bindings for the Rust [`config-disassembler`](https://crates.io/crates/config-disassembler) crate.

Disassemble configuration files (XML, JSON, JSON5, JSONC, YAML, TOON, TOML, INI) into smaller, version-control–friendly pieces — and reassemble them on demand.

> **Native Rust:** All work is done in [`config-disassembler`](https://crates.io/crates/config-disassembler); this package provides Node.js bindings via [napi-rs](https://napi.rs).

---

## Table of contents
Expand Down Expand Up @@ -373,11 +375,13 @@ Prebuilt native binaries are published as platform-scoped optional dependencies

This package ships with native binaries for these platforms and architectures:

| Platform | Architectures |
| ----------- | ---------------------------------- |
| **macOS** | x64 (Intel), arm64 (Apple Silicon) |
| **Linux** | x64 (gnu), arm64 (gnu) |
| **Windows** | x64, arm64, ia32 |
| Platform | Architectures |
| ----------- | ---------------------------------------------------------- |
| **macOS** | x64 (Intel), arm64 (Apple Silicon) |
| **Linux** | x64 (gnu + musl), arm64 (gnu + musl) |
| **Windows** | x64, arm64, ia32 |

The Linux musl builds (`config-disassembler-linux-x64-musl`, `config-disassembler-linux-arm64-musl`) cover Alpine-based images and other musl libc distributions commonly used for slim CI containers.

Adding a new target is as simple as appending its Rust triple to the `napi.targets` array in `package.json` and adding the matching entry to the build matrix in `.github/workflows/release.yml`. If other platforms or architectures require support, please open an [issue](https://github.com/mcarvin8/config-disassembler-node/issues).

Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
"aarch64-apple-darwin",
"x86_64-unknown-linux-gnu",
"aarch64-unknown-linux-gnu",
"x86_64-unknown-linux-musl",
"aarch64-unknown-linux-musl",
"x86_64-pc-windows-msvc",
"aarch64-pc-windows-msvc",
"i686-pc-windows-msvc"
Expand Down
Loading