From 683d57ef2a06c723f29639bb0d4424b5e0ed0f5a Mon Sep 17 00:00:00 2001 From: Adam Bronte Date: Thu, 19 Mar 2026 14:18:40 -0700 Subject: [PATCH 1/2] build linux musl binary and use it in the npm package --- .github/workflows/release-binaries.yml | 7 +++++++ Cargo.lock | 2 +- Cargo.toml | 2 +- scripts/npm/bundle-binaries.js | 12 +++++++----- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml index 5ff6b17..a984a86 100644 --- a/.github/workflows/release-binaries.yml +++ b/.github/workflows/release-binaries.yml @@ -21,6 +21,9 @@ jobs: - os: ubuntu-latest target: x86_64-unknown-linux-gnu binary_name: corgea + - os: ubuntu-latest + target: x86-64-unknown-linux-musl + binary_name: corgea - os: ubuntu-24.04-arm target: aarch64-unknown-linux-gnu binary_name: corgea @@ -41,6 +44,10 @@ jobs: with: ref: ${{ inputs.tag || github.ref }} + - name: Install musql tools + if: matrix.target == 'x86-64-unknown-linux-musl' + run: sudo apt-get install -y musl-tools + - name: Install Rust Target run: rustup target add ${{ matrix.target }} diff --git a/Cargo.lock b/Cargo.lock index f0d1271..5958a4d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -311,7 +311,7 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "corgea" -version = "1.8.0" +version = "1.8.3" dependencies = [ "chrono", "clap", diff --git a/Cargo.toml b/Cargo.toml index add9216..a25d59e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "corgea" -version = "1.8.2" +version = "1.8.3" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/scripts/npm/bundle-binaries.js b/scripts/npm/bundle-binaries.js index c19bee8..905cd22 100644 --- a/scripts/npm/bundle-binaries.js +++ b/scripts/npm/bundle-binaries.js @@ -6,11 +6,11 @@ const path = require("node:path"); const { unzipSync } = require("fflate"); const TARGETS = [ - { triple: "x86_64-unknown-linux-gnu", binary: "corgea" }, + { triple: "x86_64-unknown-linux-musl", binary: "corgea" }, { triple: "aarch64-unknown-linux-gnu", binary: "corgea" }, - { triple: "x86_64-apple-darwin", binary: "corgea" }, - { triple: "aarch64-apple-darwin", binary: "corgea" }, - { triple: "x86_64-pc-windows-msvc", binary: "corgea.exe" }, + { triple: "x86_64-apple-darwin", binary: "corgea" }, + { triple: "aarch64-apple-darwin", binary: "corgea" }, + { triple: "x86_64-pc-windows-msvc", binary: "corgea.exe" }, ]; function fail(message) { @@ -43,7 +43,9 @@ for (const { triple, binary } of TARGETS) { const zipBuffer = fs.readFileSync(archivePath); const entries = unzipSync(new Uint8Array(zipBuffer)); - const entry = Object.entries(entries).find(([name]) => path.basename(name) === binary); + const entry = Object.entries(entries).find( + ([name]) => path.basename(name) === binary, + ); if (!entry) { fail(`binary "${binary}" not found inside ${archiveName}`); } From 846f0a50e8c8e0243739d604eb67317a0e6184b4 Mon Sep 17 00:00:00 2001 From: Adam Bronte Date: Thu, 19 Mar 2026 14:23:01 -0700 Subject: [PATCH 2/2] fix musl target name --- .github/workflows/release-binaries.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml index a984a86..0654da2 100644 --- a/.github/workflows/release-binaries.yml +++ b/.github/workflows/release-binaries.yml @@ -22,7 +22,7 @@ jobs: target: x86_64-unknown-linux-gnu binary_name: corgea - os: ubuntu-latest - target: x86-64-unknown-linux-musl + target: x86_64-unknown-linux-musl binary_name: corgea - os: ubuntu-24.04-arm target: aarch64-unknown-linux-gnu @@ -44,8 +44,8 @@ jobs: with: ref: ${{ inputs.tag || github.ref }} - - name: Install musql tools - if: matrix.target == 'x86-64-unknown-linux-musl' + - name: Install musl tools + if: matrix.target == 'x86_64-unknown-linux-musl' run: sudo apt-get install -y musl-tools - name: Install Rust Target