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
61 changes: 42 additions & 19 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
branches:
- master
pull_request:
workflow_dispatch:

jobs:
Test:
Expand All @@ -15,18 +16,10 @@ jobs:
- ubuntu-latest
- macos-13
- windows-latest
node_version:
- 20
- 22
cpp_arch:
- x64
include:
- os: macos-14 # arm
node-version: 16
cpp_arch: arm64

- os: macos-14 # arm
node-version: 22
cpp_arch: arm64
steps:
- uses: actions/checkout@v4
Expand All @@ -35,20 +28,40 @@ jobs:

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

- uses: pnpm/action-setup@v4

# - name: Setup Cpp
# if: ${{ matrix.native }}
# uses: aminya/setup-cpp@v1
# with:
# vcvarsall: true
# cmake: true
# ninja: true
# python: true
# vcpkg: ee2d2a100103e0f3613c60655dcf15be7d5157b8
# architecture: ${{ matrix.cpp_arch }}
- name: Setup Cpp
uses: aminya/setup-cpp@v1
with:
vcvarsall: true
cmake: true
ninja: true
python: true
vcpkg: 608d1dbcd6969679f82b1ca6b89d58939c9b228e
architecture: ${{ matrix.cpp_arch }}

- name: Cache
uses: actions/cache@v4
with:
path: |
./node_modules
~/.pnpm-store
~/vcpkg
key: ${{ matrix.os }}-${{ matrix.cpp_arch }}-${{ hashFiles('pnpm-lock.yaml', 'package.json') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.cpp_arch }}-

- name: Install Zeromq Mac-OS Dependencies
if: ${{ contains(matrix.os, 'macos') }}
run: |
brew install gnutls autoconf automake libtool
- name: Install Zeromq Ubuntu Dependencies
if: ${{ contains(matrix.os, 'ubuntu') }}
run: |
sudo apt-get update -q -y
sudo apt-get install -y --no-install-recommends autoconf automake libtool

- name: Install dependencies
run: pnpm install
Expand All @@ -61,3 +74,13 @@ jobs:

- name: Tests
run: pnpm test

- name: Setup Node 12
if: matrix.os != 'macos-14'
uses: actions/setup-node@v4
with:
node-version: 12

- name: Smoke test Node 12
if: matrix.os != 'macos-14'
run: node ./build/main.js --help
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22.14.0
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,31 +28,31 @@ Usage: cmake-ts build [options]
Build the project

Options:
-c, --configs <configs...>
-c, --configs <configs...>
Named config(s) to build, which could be from default configs or the ones defined in the config file (package.json)

If no config is provided, it will build for the current runtime on the current system with the Release build type

The default configs are combinations of `<Runtime>`, `<BuildType>`, `<Platform>`, and `<Architecture>`.

- `<Runtime>`: the runtime to use

e.g.: `node`, `electron`, `iojs`

- `<BuildType>`: the cmake build type (optimization level)

e.g.: `debug`, `release`, or `relwithdebinfo`

- `<Platform>`: the target platform

e.g.: `win32`, `linux`, `darwin`, `aix`, `android`, `freebsd`, `haiku`, `openbsd`, `sunos`, `cygwin`, `netbsd`

- `<Architecture>`: the target architecture

e.g.: `x64`, `arm64`, `ia32`, `arm`, `loong64`, `mips`, `mipsel`, `ppc`, `ppc64`, `riscv64`, `s390`, `s390x`

Any combination of `<BuildType>`, `<Runtime>`, `<Platform>`, and `<Architecture>` is valid. Some examples:

- `release`
- `debug`
- `relwithdebinfo`
Expand All @@ -68,20 +68,20 @@ Options:
- `darwin-x64-node-release`
- `darwin-arm64-node-release`
- `darwin-arm64-electron-relwithdebinfo`

You can also define your own configs in the config file (package.json).

- `<ConfigName>`: the name of the config

e.g.: `my-config`

The configs can also be in format of `named-<property>`, which builds the configs that match the property.

- `named-os`: build all the configs in the config file that have the same OS
- `named-os-dev`: build all the configs in the config file that have the same OS and `dev` is true
- `named-all`: build all the configs in the config file


The configs can be combined with `,` or multiple `--configs` flags. They will be merged together.
(default: [])
-h, --help display help for command
Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@
"@biomejs/biome": "^1.9.4",
"prettier": "^3.5.3",
"prettier-config-atomic": "^4.0.0",
"zeromq": "^6.3.0",
"execa": "^9.5.2",
"zeromq": "^6.4.1",
"ci-info": "^4.2.0",
"fast-glob": "^3.3.2",
"fs-extra": "^10",
Expand All @@ -120,6 +121,9 @@
"$schema": "https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/package.json",
"pnpm": {
"onlyBuiltDependencies": ["@biomejs/biome", "core-js", "esbuild"],
"ignoredBuiltDependencies": ["zeromq"]
"ignoredBuiltDependencies": ["zeromq"],
"patchedDependencies": {
"zeromq": "patches/zeromq.patch"
}
}
}
12 changes: 12 additions & 0 deletions patches/zeromq.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/src/module.h b/src/module.h
index b28d789c8c950efaafd2c36b7d14351686cb7712..79d190e4fb0a0d731070597e46feffd091efebaf 100644
--- a/src/module.h
+++ b/src/module.h
@@ -2,6 +2,7 @@

#include <cstdio>
#include <future>
+#include <chrono>

#include "./closable.h"
#include "./outgoing_msg.h"
Loading