diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d33372f..b9e5267 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - electron: [29.4.6, 30.5.1, 31.6.0] + electron: [29.0.0, 30.0.0, 31.0.0] name: build Electron-${{ matrix.electron }} steps: @@ -57,7 +57,7 @@ jobs: env: DOTNET_CLI_TELEMETRY_OPTOUT: 1 - - uses: bhowell2/github-substring-action@1.0.2 + - uses: agracio/github-substring-action@v1.0.0 id: electron_version with: value: "${{ matrix.electron }}" @@ -76,7 +76,6 @@ jobs: timeout-minutes: 30 run: | node-gyp configure build --target=${{ matrix.electron }} --disturl=https://electronjs.org/headers --runtime=electron --release --arch=ia32 - # cmd /c copy /y build\Release\edge_*.node lib\native\win32\ia32\${{ steps.electron_version.outputs.substring }}.0.0 cmd /c copy /y build\Release\edge_*.node release\ia32\${{ matrix.electron }} cmd /c rmdir /S /Q build @@ -84,7 +83,6 @@ jobs: timeout-minutes: 30 run: | node-gyp configure build --target=${{ matrix.electron }} --disturl=https://electronjs.org/headers --runtime=electron --release --arch=x64 - # cmd /c copy /y build\Release\edge_*.node lib\native\win32\x64\${{ steps.electron_version.outputs.substring }}.0.0 cmd /c copy /y build\Release\edge_*.node release\x64\${{ matrix.electron }} cmd /c rmdir /S /Q build @@ -99,13 +97,12 @@ jobs: (Get-Content -Raw build/edge_nativeclr.vcxproj) -replace 'Strict', '' | Out-File -Encoding Utf8 build/edge_nativeclr.vcxproj node-gyp build - # cmd /c copy /y build\Release\edge_*.node lib\native\win32\arm64\${{ steps.electron_version.outputs.substring }}.0.0 cmd /c copy /y build\Release\edge_*.node release\arm64\${{ matrix.electron }} cmd /c rmdir /S /Q build - name: Upload artifacts - uses: actions/upload-artifact@v4.3.3 + uses: actions/upload-artifact@v4 if: success() with: name: ${{ matrix.electron }} @@ -113,16 +110,34 @@ jobs: release test: - runs-on: windows-2022 + runs-on: ${{ matrix.os }} needs: build strategy: + matrix: + # electron: [29.4.6, 30.5.1, 31.6.0] + electron: [29.4.6] + os: [windows-2022] fail-fast: false name: test Electron steps: - - uses: bhowell2/github-substring-action@1.0.2 + - uses: agracio/github-substring-action@v1.0.0 id: electron_version with: value: "test" length_from_start: 2 + + - name: Create release folder + run: | + cmd /c if not exist "lib\native\win32\ia32\${{ steps.electron_version.outputs.substring }}.0.0" mkdir "lib\native\win32\ia32\${{ steps.electron_version.outputs.substring }}.0.0" + cmd /c if not exist "lib\native\win32\x64\${{ steps.electron_version.outputs.substring }}.0.0" mkdir "lib\native\win32\x64\${{ steps.electron_version.outputs.substring }}.0.0" + cmd /c if not exist "lib\native\win32\arm64\${{ steps.electron_version.outputs.substring }}.0.0" mkdir "lib\native\win32\arm64\${{ steps.electron_version.outputs.substring }}.0.0" + + - name: Download All Artifacts + uses: actions/download-artifact@v4 + with: + path: release + pattern: my-artifact-* + - run: ls -R my-artifact + \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5eae1c6..9f757ac 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -78,11 +78,12 @@ jobs: node -v && npm -v && dotnet --version && node -p process.platform && node -p process.arch - name: setup electron version + shell: bash run: | sed -i -e 's/"electron": "=31.6.0"/"electron": "=${{ matrix.electron }}"/g' package.json - if: runner.os == 'Windows' - uses: bhowell2/github-substring-action@1.0.2 + uses: agracio/github-substring-action@v1.0.0 id: electron_version with: value: "${{ matrix.electron }}" @@ -153,7 +154,7 @@ jobs: run: node tools/mergeTests.js - name: Upload artifacts - uses: actions/upload-artifact@v4.3.3 + uses: actions/upload-artifact@v4 if: success() with: name: ${{ matrix.os }}-${{ matrix.electron }} diff --git a/src/CoreCLREmbedding/coreclrembedding.cpp b/src/CoreCLREmbedding/coreclrembedding.cpp index 7f9b1ec..91474ea 100644 --- a/src/CoreCLREmbedding/coreclrembedding.cpp +++ b/src/CoreCLREmbedding/coreclrembedding.cpp @@ -520,7 +520,7 @@ HRESULT CoreClrEmbedding::Initialize(BOOL debugMode) property_values.push_back(clrjit_path_cstr.data()); } - for (int i = 0; i < g_init.cfg_keys.size(); ++i) + for (size_t i = 0; i < g_init.cfg_keys.size(); ++i) { property_keys.push_back(g_init.cfg_keys[i].data()); property_values.push_back(g_init.cfg_values[i].data()); diff --git a/src/CoreCLREmbedding/deps/deps_format.cpp b/src/CoreCLREmbedding/deps/deps_format.cpp index 3305528..9ed863c 100644 --- a/src/CoreCLREmbedding/deps/deps_format.cpp +++ b/src/CoreCLREmbedding/deps/deps_format.cpp @@ -53,7 +53,7 @@ void deps_json_t::reconcile_libraries_with_targets( const pal::string_t& hash = properties.at(_X("sha512")).as_string(); bool serviceable = properties.at(_X("serviceable")).as_bool(); - for (int i = 0; i < deps_entry_t::s_known_asset_types.size(); ++i) + for (size_t i = 0; i < deps_entry_t::s_known_asset_types.size(); ++i) { bool rid_specific = false; for (const auto& rel_path : get_rel_paths_by_asset_type_fn(library.first, i, &rid_specific)) @@ -169,7 +169,7 @@ bool deps_json_t::process_runtime_targets(const json_value& json, const pal::str for (const auto& file : files) { const auto& type = file.second.at(_X("assetType")).as_string(); - for (int i = 0; i < deps_entry_t::s_known_asset_types.size(); ++i) + for (size_t i = 0; i < deps_entry_t::s_known_asset_types.size(); ++i) { if (pal::strcasecmp(type.c_str(), deps_entry_t::s_known_asset_types[i]) == 0) { @@ -195,7 +195,7 @@ bool deps_json_t::process_targets(const json_value& json, const pal::string_t& t { // if (package.second.at(_X("type")).as_string() != _X("package")) continue; const auto& asset_types = package.second.as_object(); - for (int i = 0; i < deps_entry_t::s_known_asset_types.size(); ++i) + for (size_t i = 0; i < deps_entry_t::s_known_asset_types.size(); ++i) { auto iter = asset_types.find(deps_entry_t::s_known_asset_types[i]); if (iter != asset_types.end()) diff --git a/src/CoreCLREmbedding/json/casablanca/include/stdafx.h b/src/CoreCLREmbedding/json/casablanca/include/stdafx.h index 553d828..aaf1e36 100644 --- a/src/CoreCLREmbedding/json/casablanca/include/stdafx.h +++ b/src/CoreCLREmbedding/json/casablanca/include/stdafx.h @@ -49,7 +49,9 @@ #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers -// Windows Header Files: +#endif + +#ifndef NOMINMAX #define NOMINMAX #endif diff --git a/src/CoreCLREmbedding/pal/pal.h b/src/CoreCLREmbedding/pal/pal.h index 64fd801..c8dd260 100644 --- a/src/CoreCLREmbedding/pal/pal.h +++ b/src/CoreCLREmbedding/pal/pal.h @@ -33,7 +33,9 @@ #if defined(_WIN32) +#ifndef NOMINMAX #define NOMINMAX +#endif #include #define xerr std::wcerr diff --git a/src/dotnet/clrfunc.cpp b/src/dotnet/clrfunc.cpp index 0b3e410..2426160 100644 --- a/src/dotnet/clrfunc.cpp +++ b/src/dotnet/clrfunc.cpp @@ -30,7 +30,7 @@ void clrFuncProxyNearDeath(const Nan::WeakCallbackInfo &data) #pragma managed(push, off) static Nan::Persistent proxyFactory; static Nan::Persistent proxyFunction; -#pragma managed(push, pop) +#pragma managed(pop) v8::Local ClrFunc::Initialize(System::Func^>^ func) { diff --git a/src/dotnet/nodejsfuncinvokecontext.cpp b/src/dotnet/nodejsfuncinvokecontext.cpp index 657e200..0b1ae80 100644 --- a/src/dotnet/nodejsfuncinvokecontext.cpp +++ b/src/dotnet/nodejsfuncinvokecontext.cpp @@ -66,7 +66,7 @@ NodejsFuncInvokeContext::!NodejsFuncInvokeContext() #pragma managed(push, off) static Nan::Persistent callbackFactory; static Nan::Persistent callbackFunction; -#pragma managed(push, pop) +#pragma managed(pop) void NodejsFuncInvokeContext::CallFuncOnV8Thread() {