From c32ae572113fdffe09454d79f8143688f6a1efa2 Mon Sep 17 00:00:00 2001 From: Murat Dogan Date: Sun, 1 Dec 2024 19:52:30 +0100 Subject: [PATCH 1/3] x64 --- .github/workflows/build-win.yml | 43 ++------------------------------- 1 file changed, 2 insertions(+), 41 deletions(-) diff --git a/.github/workflows/build-win.yml b/.github/workflows/build-win.yml index 3b277a09..c5a2035a 100644 --- a/.github/workflows/build-win.yml +++ b/.github/workflows/build-win.yml @@ -6,9 +6,6 @@ on: # tags: # - v* -env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: true - jobs: build-windows-x64: runs-on: windows-2022 @@ -18,50 +15,14 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: ilammy/msvc-dev-cmd@v1 - name: Install OpenSSL - run: choco install openssl + run: choco install openssl -y - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - name: Build - run: set npm_config_cache= && set NPM_CONFIG_CACHE= && npm install --build-from-source - env: - CI: true - # - name: Test - # run: npm run test - # env: - # CI: true - - name: Upload - run: node_modules/.bin/prebuild -r napi --upload -u ${{ secrets.GITHUB_TOKEN }} - env: - CI: true - - build-windows-x86: - runs-on: windows-2022 - strategy: - matrix: - node_version: [18.x] - node_arch: - - x86 - steps: - - uses: actions/checkout@v4 - - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: x86 - - name: Install OpenSSL - # openssl v3.1.1 [Approved] - # openssl package files install completed. Performing other installation steps. - # ERROR: 32-bit installation is not supported for openssl - run: choco install openssl --x86=true --version=1.1.1.2100 - - name: Use Node.js ${{ matrix.node_version }} - uses: aminya/setup-node@x86 - with: - node-version: ${{ matrix.node_version }} - node-arch: ${{ matrix.node_arch }} - - name: Build - run: set npm_config_cache= && set NPM_CONFIG_CACHE= && npm install --build-from-source + run: npm install --build-from-source env: CI: true # - name: Test From cee014bd30432d2b587a947f31b87bb1a805e289 Mon Sep 17 00:00:00 2001 From: Murat Dogan Date: Sun, 1 Dec 2024 20:57:23 +0100 Subject: [PATCH 2/3] add node.lib directive --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e938489..d4e47f7a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -87,3 +87,8 @@ if(WIN32) endif() target_link_libraries(${PROJECT_NAME} PRIVATE ${LINK_LIBRARIES}) + +if(MSVC AND CMAKE_JS_NODELIB_DEF AND CMAKE_JS_NODELIB_TARGET) + # Generate node.lib + execute_process(COMMAND ${CMAKE_AR} /def:${CMAKE_JS_NODELIB_DEF} /out:${CMAKE_JS_NODELIB_TARGET} ${CMAKE_STATIC_LINKER_FLAGS}) +endif() From ff0c09ddcf41bf896ca18a5190474c729d5786ae Mon Sep 17 00:00:00 2001 From: Murat Dogan Date: Sun, 1 Dec 2024 21:01:51 +0100 Subject: [PATCH 3/3] win x86 --- .github/workflows/build-win.yml | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/.github/workflows/build-win.yml b/.github/workflows/build-win.yml index c5a2035a..0724c397 100644 --- a/.github/workflows/build-win.yml +++ b/.github/workflows/build-win.yml @@ -33,3 +33,38 @@ jobs: run: node_modules/.bin/prebuild -r napi --upload -u ${{ secrets.GITHUB_TOKEN }} env: CI: true + + build-windows-x86: + runs-on: windows-2019 + strategy: + matrix: + node_version: [18] + node_arch: + - x86 + steps: + - uses: actions/checkout@v4 + - uses: ilammy/msvc-dev-cmd@v1 + with: + arch: x86 + - name: Install OpenSSL + # openssl v3.1.1 [Approved] + # openssl package files install completed. Performing other installation steps. + # ERROR: 32-bit installation is not supported for openssl + run: choco install openssl --x86=true --version=1.1.1.2100 + - name: Use Node.js ${{ matrix.node_version }} + uses: aminya/setup-node@x86 + with: + node-version: ${{ matrix.node_version }} + node-arch: ${{ matrix.node_arch }} + - name: Build + run: npm install --build-from-source + env: + CI: true + # - name: Test + # run: npm run test + # env: + # CI: true + - name: Upload + run: node_modules/.bin/prebuild -r napi --upload -u ${{ secrets.GITHUB_TOKEN }} + env: + CI: true