Skip to content

Commit

Permalink
merging updates from edge-js, updating workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
agracio committed Sep 16, 2024
1 parent f389df7 commit b0acf95
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 17 deletions.
31 changes: 23 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 }}"
Expand All @@ -76,15 +76,13 @@ 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
- name: Build x64
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
Expand All @@ -99,30 +97,47 @@ jobs:
(Get-Content -Raw build/edge_nativeclr.vcxproj) -replace '<FloatingPointModel>Strict</FloatingPointModel>', '<!-- <FloatingPointModel>Strict</FloatingPointModel> -->' | 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 }}
path: |
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


5 changes: 3 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion src/CoreCLREmbedding/coreclrembedding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
6 changes: 3 additions & 3 deletions src/CoreCLREmbedding/deps/deps_format.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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)
{
Expand All @@ -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())
Expand Down
4 changes: 3 additions & 1 deletion src/CoreCLREmbedding/json/casablanca/include/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions src/CoreCLREmbedding/pal/pal.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@

#if defined(_WIN32)

#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <windows.h>

#define xerr std::wcerr
Expand Down
2 changes: 1 addition & 1 deletion src/dotnet/clrfunc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void clrFuncProxyNearDeath(const Nan::WeakCallbackInfo<T> &data)
#pragma managed(push, off)
static Nan::Persistent<v8::Function> proxyFactory;
static Nan::Persistent<v8::Function> proxyFunction;
#pragma managed(push, pop)
#pragma managed(pop)

v8::Local<v8::Function> ClrFunc::Initialize(System::Func<System::Object^,System::Threading::Tasks::Task<System::Object^>^>^ func)
{
Expand Down
2 changes: 1 addition & 1 deletion src/dotnet/nodejsfuncinvokecontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ NodejsFuncInvokeContext::!NodejsFuncInvokeContext()
#pragma managed(push, off)
static Nan::Persistent<v8::Function> callbackFactory;
static Nan::Persistent<v8::Function> callbackFunction;
#pragma managed(push, pop)
#pragma managed(pop)

void NodejsFuncInvokeContext::CallFuncOnV8Thread()
{
Expand Down

0 comments on commit b0acf95

Please sign in to comment.