diff --git a/.github/workflows/sdk-typescript-publish.yml b/.github/workflows/sdk-typescript-publish.yml index 6c5da819..4653146d 100644 --- a/.github/workflows/sdk-typescript-publish.yml +++ b/.github/workflows/sdk-typescript-publish.yml @@ -212,9 +212,67 @@ jobs: if-no-files-found: error retention-days: 7 + build-linux-arm64: + name: build (aarch64-unknown-linux-gnu) + needs: verify-tag + runs-on: ubuntu-latest + # QEMU runs the arm64 node:20-bullseye container on the x86_64 host so we + # get a NATIVE compile inside the container (no cross-sysroot tricks). + # The resulting .node loads on every Linux with GLIBC >= 2.31: + # ARM64 Vercel sandbox, ARM64 RHEL 9, Amazon Linux 2/2023 (aarch64), etc. + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up QEMU for arm64 containers + uses: docker/setup-qemu-action@v3 + + - name: Build native addon (linux arm64 gnu, native debian-bullseye via QEMU) + run: | + docker run --platform linux/arm64 \ + -v ${{ github.workspace }}:/workspace \ + -w /workspace/sdk/typescript \ + node:20-bullseye \ + bash -c ' + set -e + apt-get update + apt-get install -y --no-install-recommends \ + build-essential \ + pkg-config \ + ca-certificates \ + curl \ + unzip + + PROTOC_VERSION=29.3 + curl -fsSL "https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-aarch_64.zip" -o /tmp/protoc.zip + unzip -o /tmp/protoc.zip -d /usr/local + chmod +x /usr/local/bin/protoc + protoc --version + ls /usr/local/include/google/protobuf/timestamp.proto + + curl --proto "=https" --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain none + export PATH="$HOME/.cargo/bin:$PATH" + rustc --version + cargo --version + + npm ci + npm run build -- --target aarch64-unknown-linux-gnu + + ls -lh codegraff-sdk.*.node + objdump -T codegraff-sdk.linux-arm64-gnu.node | grep GLIBC | sort -u | tail -10 || true + ' + + - name: Upload .node artifact + uses: actions/upload-artifact@v4 + with: + name: bindings-aarch64-unknown-linux-gnu + path: sdk/typescript/codegraff-sdk.*.node + if-no-files-found: error + retention-days: 7 + publish: name: publish to npm - needs: [verify-tag, build, build-linux] + needs: [verify-tag, build, build-linux, build-linux-arm64] runs-on: ubuntu-latest environment: name: npm-publish diff --git a/sdk/typescript/package-lock.json b/sdk/typescript/package-lock.json index 9ed498d3..2d038549 100644 --- a/sdk/typescript/package-lock.json +++ b/sdk/typescript/package-lock.json @@ -1,12 +1,12 @@ { "name": "@codegraff/sdk", - "version": "0.1.5", + "version": "0.1.14", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@codegraff/sdk", - "version": "0.1.5", + "version": "0.1.14", "license": "MIT", "devDependencies": { "@cursor/sdk": "^1.0.12", @@ -17,11 +17,11 @@ "node": ">= 18" }, "optionalDependencies": { - "@codegraff/sdk-darwin-arm64": "0.1.5", - "@codegraff/sdk-darwin-x64": "0.1.5", - "@codegraff/sdk-linux-arm64-gnu": "0.1.5", - "@codegraff/sdk-linux-x64-gnu": "0.1.5", - "@codegraff/sdk-win32-x64-msvc": "0.1.5" + "@codegraff/sdk-darwin-arm64": "0.1.14", + "@codegraff/sdk-darwin-x64": "0.1.14", + "@codegraff/sdk-linux-arm64-gnu": "0.1.14", + "@codegraff/sdk-linux-x64-gnu": "0.1.14", + "@codegraff/sdk-win32-x64-msvc": "0.1.14" } }, "node_modules/@bufbuild/protobuf": { @@ -32,19 +32,74 @@ "license": "(Apache-2.0 AND BSD-3-Clause)" }, "node_modules/@codegraff/sdk-darwin-arm64": { - "optional": true + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/@codegraff/sdk-darwin-arm64/-/sdk-darwin-arm64-0.1.14.tgz", + "integrity": "sha512-mbdNYMOriCogwR5iD0563CKrkdRZOg8ZR0ly92mtv5SXIGHTSrsRuqLHz1aaIdfBoo9Q1Sr1IWJnnRWoLpuO5g==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 18" + } }, "node_modules/@codegraff/sdk-darwin-x64": { - "optional": true + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/@codegraff/sdk-darwin-x64/-/sdk-darwin-x64-0.1.14.tgz", + "integrity": "sha512-A3q9fZ3jbDmhN68ZN/dVDjEHsociBzaSRxzo4x9tpS1HS9w2ZUl9nfghIyq2r1cb5/aRleHlxQ4gG1xm3fJbYw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 18" + } }, "node_modules/@codegraff/sdk-linux-arm64-gnu": { "optional": true }, "node_modules/@codegraff/sdk-linux-x64-gnu": { - "optional": true + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/@codegraff/sdk-linux-x64-gnu/-/sdk-linux-x64-gnu-0.1.14.tgz", + "integrity": "sha512-rSogQgrnTKI0tu2NvBzWjxvu/BuzB1h4xmaN87iNZDXjLwZSnFLppD430PkpSgYQj5FXG2kw0VOI7noCzglhTg==", + "cpu": [ + "x64" + ], + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 18" + } }, "node_modules/@codegraff/sdk-win32-x64-msvc": { - "optional": true + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/@codegraff/sdk-win32-x64-msvc/-/sdk-win32-x64-msvc-0.1.14.tgz", + "integrity": "sha512-T44f5ZO10evh84Wi3gIPDzmuAndT97UeVXxXrNnGGJp0MMhvViUmHuInOyCTY8DJUCTbeQmLLQqLi5zRagUO5g==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 18" + } }, "node_modules/@connectrpc/connect": { "version": "1.7.0",