diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index af7b1fa..77611c5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -98,6 +98,9 @@ jobs: # These actually are not relevant since brew just pulls the latest version otp: "latest" elixir: "latest" + - os: windows-2022 + otp: "27.0.1" + elixir: "1.17.2" steps: - name: Clone the repository @@ -117,6 +120,12 @@ jobs: run: | curl -Lo tigerbeetle.zip https://mac.tigerbeetle.com && unzip tigerbeetle.zip + - name: Fetch TigerBeetle for Windows + if: runner.os == 'Windows' + working-directory: ./src/tigerbeetle + run: | + curl.exe -Lo tigerbeetle.zip https://windows.tigerbeetle.com; Expand-Archive tigerbeetle.zip . + - name: Start TigerBeetle working-directory: ./src/tigerbeetle run: | @@ -124,7 +133,7 @@ jobs: ./tigerbeetle start --addresses=3000 --development 0_0.tigerbeetle & - name: Install OTP and Elixir - if: runner.os == 'Linux' + if: runner.os == 'Linux' || runner.os == 'Windows' uses: erlef/setup-beam@v1 with: otp-version: ${{ matrix.otp }} diff --git a/build.zig b/build.zig index c911404..d097e0a 100644 --- a/build.zig +++ b/build.zig @@ -47,7 +47,9 @@ pub fn build(b: *std.Build) void { // Do this so `lib` doesn't get prepended to the lib name, and `.so` is used as suffix also // on MacOS, since it's required by the NIF loading mechanism. // See https://github.com/ziglang/zig/issues/2231 - const nif_so_install = b.addInstallFileWithDir(lib.getEmittedBin(), .lib, "tigerbeetlex.so"); + // Windows still needs the .dll suffix + const lib_name = if (target.result.os.tag == .windows) "tigerbeetlex.dll" else "tigerbeetlex.so"; + const nif_so_install = b.addInstallFileWithDir(lib.getEmittedBin(), .lib, lib_name); nif_so_install.step.dependOn(&lib.step); b.getInstallStep().dependOn(&nif_so_install.step); }