Skip to content

Commit 7bda7f8

Browse files
authored
Merge branch 'ElectronNET:develop' into develop
2 parents 1d382c6 + 20212cd commit 7bda7f8

130 files changed

Lines changed: 1601 additions & 577 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/integration-tests.yml

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,28 @@ concurrency:
1212

1313
jobs:
1414
tests:
15-
name: Integration Tests (${{ matrix.os }})
15+
name: Integration Tests (${{ matrix.os }} / Electron ${{ matrix.electronVersion }})
1616
runs-on: ${{ matrix.os }}
1717
strategy:
1818
fail-fast: false
1919
matrix:
20+
os: [ubuntu-22.04, ubuntu-24.04, windows-2022, windows-2025, macos-14, macos-15-intel, macos-26]
21+
electronVersion: ['30.4.0', '38.2.2']
2022
include:
23+
- os: ubuntu-22.04
24+
rid: linux-x64
2125
- os: ubuntu-24.04
2226
rid: linux-x64
2327
- os: windows-2022
2428
rid: win-x64
29+
- os: windows-2025
30+
rid: win-x64
2531
- os: macos-14
2632
rid: osx-arm64
33+
- os: macos-15-intel
34+
rid: osx-x64
35+
- os: macos-26
36+
rid: osx-arm64
2737

2838
env:
2939
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
@@ -46,50 +56,52 @@ jobs:
4656
node-version: '22'
4757

4858
- name: Restore
49-
run: dotnet restore -r ${{ matrix.rid }} -p:RuntimeIdentifier=${{ matrix.rid }} src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj
59+
run: dotnet restore -r ${{ matrix.rid }} -p:RuntimeIdentifier=${{ matrix.rid }} -p:ElectronVersion=${{ matrix.electronVersion }} src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj
5060

5161
- name: Build
52-
run: dotnet build --no-restore -c Release -r ${{ matrix.rid }} -p:RuntimeIdentifier=${{ matrix.rid }} src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj
62+
run: dotnet build --no-restore -c Release -r ${{ matrix.rid }} -p:RuntimeIdentifier=${{ matrix.rid }} -p:ElectronVersion=${{ matrix.electronVersion }} src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj
5363

5464
- name: Install Linux GUI dependencies
5565
if: runner.os == 'Linux'
5666
run: |
5767
set -e
5868
sudo apt-get update
59-
# Core Electron dependencies
69+
. /etc/os-release
70+
if [ "$VERSION_ID" = "24.04" ]; then ALSA_PKG=libasound2t64; else ALSA_PKG=libasound2; fi
71+
echo "Using ALSA package: $ALSA_PKG"
6072
sudo apt-get install -y xvfb \
61-
libgtk-3-0 libnss3 libgdk-pixbuf-2.0-0 libdrm2 libgbm1 libxss1 libxtst6 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libx11-xcb1 libasound2t64
73+
libgtk-3-0 libnss3 libgdk-pixbuf-2.0-0 libdrm2 libgbm1 libxss1 libxtst6 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libx11-xcb1 "$ALSA_PKG"
6274
6375
- name: Run tests (Linux)
6476
if: runner.os == 'Linux'
6577
continue-on-error: true
6678
run: |
67-
mkdir -p test-results/Ubuntu
79+
mkdir -p test-results
6880
xvfb-run -a dotnet test src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj \
69-
-c Release --no-build -r ${{ matrix.rid }} -p:RuntimeIdentifier=${{ matrix.rid }} \
70-
--logger "trx;LogFileName=Ubuntu.trx" \
81+
-c Release --no-build -r ${{ matrix.rid }} -p:RuntimeIdentifier=${{ matrix.rid }} -p:ElectronVersion=${{ matrix.electronVersion }} \
82+
--logger "trx;LogFileName=${{ matrix.os }}-electron-${{ matrix.electronVersion }}.trx" \
7183
--logger "console;verbosity=detailed" \
7284
--results-directory test-results
7385
7486
- name: Run tests (Windows)
7587
if: runner.os == 'Windows'
7688
continue-on-error: true
7789
run: |
78-
New-Item -ItemType Directory -Force -Path test-results/Windows | Out-Null
79-
dotnet test src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj -c Release --no-build -r ${{ matrix.rid }} -p:RuntimeIdentifier=${{ matrix.rid }} --logger "trx;LogFileName=Windows.trx" --logger "console;verbosity=detailed" --results-directory test-results
90+
New-Item -ItemType Directory -Force -Path test-results | Out-Null
91+
dotnet test src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj -c Release --no-build -r ${{ matrix.rid }} -p:RuntimeIdentifier=${{ matrix.rid }} -p:ElectronVersion=${{ matrix.electronVersion }} --logger "trx;LogFileName=${{ matrix.os }}-electron-${{ matrix.electronVersion }}.trx" --logger "console;verbosity=detailed" --results-directory test-results
8092
8193
- name: Run tests (macOS)
8294
if: runner.os == 'macOS'
8395
continue-on-error: true
8496
run: |
85-
mkdir -p test-results/macOS
86-
dotnet test src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj -c Release --no-build -r ${{ matrix.rid }} -p:RuntimeIdentifier=${{ matrix.rid }} --logger "trx;LogFileName=macOS.trx" --logger "console;verbosity=detailed" --results-directory test-results
97+
mkdir -p test-results
98+
dotnet test src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj -c Release --no-build -r ${{ matrix.rid }} -p:RuntimeIdentifier=${{ matrix.rid }} -p:ElectronVersion=${{ matrix.electronVersion }} --logger "trx;LogFileName=${{ matrix.os }}-electron-${{ matrix.electronVersion }}.trx" --logger "console;verbosity=detailed" --results-directory test-results
8799
88100
- name: Upload raw test results
89101
if: always()
90102
uses: actions/upload-artifact@v4
91103
with:
92-
name: test-results-${{ matrix.os }}
104+
name: test-results-${{ matrix.os }}-electron-${{ matrix.electronVersion }}
93105
path: test-results/*.trx
94106
retention-days: 7
95107

@@ -121,23 +133,25 @@ jobs:
121133
dotnet new tool-manifest
122134
dotnet tool install DotnetCtrfJsonReporter --local
123135
124-
- name: Convert TRX → CTRF and clean names (keep suites; set filePath=OS)
136+
- name: Convert TRX → CTRF and clean names (filePath=OS|Electron X.Y.Z)
125137
shell: bash
126138
run: |
127139
set -euo pipefail
128140
mkdir -p ctrf
129141
shopt -s globstar nullglob
130142
conv=0
131143
for trx in test-results/**/*.trx; do
132-
fname="$(basename "$trx")"
133-
os="${fname%.trx}"
134-
outdir="ctrf/${os}"
144+
base="$(basename "$trx" .trx)" # e.g. ubuntu-22.04-electron-30.4.0
145+
os="${base%%-electron-*}"
146+
electron="${base#*-electron-}"
147+
label="$os|Electron $electron"
148+
outdir="ctrf/${label}"
135149
mkdir -p "$outdir"
136150
out="${outdir}/ctrf-report.json"
137151
138152
dotnet tool run DotnetCtrfJsonReporter -p "$trx" -d "$outdir" -f "ctrf-report.json"
139153
140-
jq --arg os "$os" '.results.tests |= map(.filePath = $os)' "$out" > "${out}.tmp" && mv "${out}.tmp" "$out"
154+
jq --arg fp "$label" '.results.tests |= map(.filePath = $fp)' "$out" > "${out}.tmp" && mv "${out}.tmp" "$out"
141155
142156
echo "Converted & normalized $trx -> $out"
143157
conv=$((conv+1))
@@ -149,7 +163,6 @@ jobs:
149163
uses: ctrf-io/github-test-reporter@v1
150164
with:
151165
report-path: 'ctrf/**/*.json'
152-
153166
summary: true
154167
pull-request: false
155168
status-check: false
@@ -162,7 +175,6 @@ jobs:
162175
group-by: 'suite'
163176
upload-artifact: true
164177
fetch-previous-results: true
165-
166178
summary-report: false
167179
summary-delta-report: true
168180
github-report: true
@@ -180,7 +192,6 @@ jobs:
180192
flaky-rate-report: true
181193
fail-rate-report: false
182194
slowest-report: false
183-
184195
report-order: 'summary-delta-report,failed-report,skipped-report,suite-folded-report,file-report,previous-results-report,github-report'
185196
env:
186197
GITHUB_TOKEN: ${{ github.token }}

Changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# 0.3.0
2+
3+
## ElectronNET.Core
4+
5+
- Updated infrastructure (#937, #939) @softworkz
6+
- Fixed output path for `electron-builder` (#942) @softworkz
7+
- Fixed previous API break using exposed `JsonElement` objects (#938) @softworkz
8+
19
# 0.2.0
210

311
## ElectronNET.Core

docs/GettingStarted/Console-App.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Add the Electron.NET configuration to your `.csproj` file:
5454
</PropertyGroup>
5555

5656
<ItemGroup>
57-
<PackageReference Include="ElectronNET.Core" Version="0.2.0" />
57+
<PackageReference Include="ElectronNET.Core" Version="0.3.0" />
5858
</ItemGroup>
5959
```
6060

src/ElectronNET.API/API/ApiBase.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,19 @@ protected void CallMethod3(object val1, object val2, object val3, [CallerMemberN
116116
}
117117

118118
protected Task<T> InvokeAsync<T>(object arg = null, [CallerMemberName] string callerName = null)
119+
{
120+
return this.InvokeAsyncWithTimeout<T>(InvocationTimeout, arg, callerName);
121+
}
122+
123+
protected Task<T> InvokeAsyncWithTimeout<T>(int invocationTimeout, object arg = null, [CallerMemberName] string callerName = null)
119124
{
120125
Debug.Assert(callerName != null, nameof(callerName) + " != null");
121126

122127
lock (this.objLock)
123128
{
124129
return this.invocators.GetOrAdd(callerName, _ =>
125130
{
126-
var getter = new Invocator<T>(this, callerName, InvocationTimeout, arg);
131+
var getter = new Invocator<T>(this, callerName, invocationTimeout, arg);
127132

128133
getter.Task<T>().ContinueWith(_ =>
129134
{
@@ -301,7 +306,7 @@ public Invocator(ApiBase apiBase, string callerName, int timeoutMs, object arg =
301306
_ = apiBase.Id >= 0 ? BridgeConnector.Socket.Emit(messageName, apiBase.Id) : BridgeConnector.Socket.Emit(messageName);
302307
}
303308

304-
System.Threading.Tasks.Task.Delay(InvocationTimeout).ContinueWith(_ =>
309+
System.Threading.Tasks.Task.Delay(timeoutMs).ContinueWith(_ =>
305310
{
306311
if (this.tcs != null)
307312
{

src/ElectronNET.API/API/App.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ public async Task<string> GetPathAsync(PathName pathName, CancellationToken canc
539539
using (cancellationToken.Register(() => taskCompletionSource.TrySetCanceled()))
540540
{
541541
BridgeConnector.Socket.Once<string>("appGetPathCompleted", taskCompletionSource.SetResult);
542-
BridgeConnector.Socket.Emit("appGetPath", pathName.GetDescription());
542+
BridgeConnector.Socket.Emit("appGetPath", pathName);
543543

544544
return await taskCompletionSource.Task
545545
.ConfigureAwait(false);
@@ -560,7 +560,7 @@ public async Task<string> GetPathAsync(PathName pathName, CancellationToken canc
560560
/// </summary>
561561
public void SetPath(PathName name, string path)
562562
{
563-
this.CallMethod2(name.GetDescription(), path);
563+
this.CallMethod2(name, path);
564564
}
565565

566566
/// <summary>

src/ElectronNET.API/API/BrowserWindow.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ public void SetAspectRatio(int aspectRatio, Size extraSize) =>
681681
/// <param name="level">Values include normal, floating, torn-off-menu, modal-panel, main-menu,
682682
/// status, pop-up-menu and screen-saver. The default is floating.
683683
/// See the macOS docs</param>
684-
public void SetAlwaysOnTop(bool flag, OnTopLevel level) => this.CallMethod2(flag, level.GetDescription());
684+
public void SetAlwaysOnTop(bool flag, OnTopLevel level) => this.CallMethod2(flag, level);
685685

686686
/// <summary>
687687
/// Sets whether the window should show always on top of other windows.
@@ -694,7 +694,7 @@ public void SetAspectRatio(int aspectRatio, Size extraSize) =>
694694
/// See the macOS docs</param>
695695
/// <param name="relativeLevel">The number of layers higher to set this window relative to the given level.
696696
/// The default is 0. Note that Apple discourages setting levels higher than 1 above screen-saver.</param>
697-
public void SetAlwaysOnTop(bool flag, OnTopLevel level, int relativeLevel) => this.CallMethod3(flag, level.GetDescription(), relativeLevel);
697+
public void SetAlwaysOnTop(bool flag, OnTopLevel level, int relativeLevel) => this.CallMethod3(flag, level, relativeLevel);
698698

699699
/// <summary>
700700
/// Whether the window is always on top of other windows.
@@ -1190,7 +1190,7 @@ public async Task<List<BrowserWindow>> GetChildWindowsAsync()
11901190
/// menu, popover, sidebar, medium-light or ultra-dark.
11911191
/// See the macOS documentation for more details.</param>
11921192
[SupportedOSPlatform("macOS")]
1193-
public void SetVibrancy(Vibrancy type) => this.CallMethod1(type.GetDescription());
1193+
public void SetVibrancy(Vibrancy type) => this.CallMethod1(type);
11941194

11951195
/// <summary>
11961196
/// Render and control web pages.

src/ElectronNET.API/API/Dock.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public async Task<int> BounceAsync(DockBounceType type, CancellationToken cancel
5757
using (cancellationToken.Register(() => tcs.TrySetCanceled()))
5858
{
5959
BridgeConnector.Socket.Once<int>("dock-bounce-completed", tcs.SetResult);
60-
BridgeConnector.Socket.Emit("dock-bounce", type.GetDescription());
60+
BridgeConnector.Socket.Emit("dock-bounce", type);
6161

6262
return await tcs.Task
6363
.ConfigureAwait(false);

src/ElectronNET.API/API/Entities/AboutPanelOptions.cs

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
namespace ElectronNET.API.Entities
1+
using System.Runtime.Versioning;
2+
3+
namespace ElectronNET.API.Entities
24
{
35
/// <summary>
46
/// About panel options.
57
/// </summary>
8+
/// <remarks>Up-to-date with Electron API 39.2</remarks>
69
public class AboutPanelOptions
710
{
811
/// <summary>
@@ -21,28 +24,35 @@ public class AboutPanelOptions
2124
public string Copyright { get; set; }
2225

2326
/// <summary>
24-
/// The app's build version number.
27+
/// The app's build version number (macOS).
2528
/// </summary>
29+
[SupportedOSPlatform("macos")]
2630
public string Version { get; set; }
2731

2832
/// <summary>
29-
/// Credit information.
33+
/// Credit information (macOS, Windows).
3034
/// </summary>
35+
[SupportedOSPlatform("macos")]
36+
[SupportedOSPlatform("windows")]
3137
public string Credits { get; set; }
3238

3339
/// <summary>
34-
/// List of app authors.
40+
/// List of app authors (Linux).
3541
/// </summary>
42+
[SupportedOSPlatform("linux")]
3643
public string[] Authors { get; set; }
3744

3845
/// <summary>
39-
/// The app's website.
46+
/// The app's website (Linux).
4047
/// </summary>
48+
[SupportedOSPlatform("linux")]
4149
public string Website { get; set; }
4250

4351
/// <summary>
44-
/// Path to the app's icon. On Linux, will be shown as 64x64 pixels while retaining aspect ratio.
52+
/// Path to the app's icon in a JPEG or PNG file format. On Linux, will be shown as 64x64 pixels while retaining aspect ratio. On Windows, a 48x48 PNG will result in the best visual quality.
4553
/// </summary>
54+
[SupportedOSPlatform("linux")]
55+
[SupportedOSPlatform("windows")]
4656
public string IconPath { get; set; }
4757
}
4858
}

src/ElectronNET.API/API/Entities/AddRepresentationOptions.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,35 @@
1+
using System.Text.Json.Serialization;
2+
13
namespace ElectronNET.API.Entities
24
{
35
/// <summary>
46
///
57
/// </summary>
8+
/// <remarks>Up-to-date with Electron API 39.2</remarks>
69
public class AddRepresentationOptions
710
{
811
/// <summary>
9-
/// Gets or sets the width
12+
/// Gets or sets the width in pixels. Defaults to 0. Required if a bitmap buffer is specified as <see cref="Buffer"/>.
1013
/// </summary>
1114
public int? Width { get; set; }
1215

1316
/// <summary>
14-
/// Gets or sets the height
17+
/// Gets or sets the height in pixels. Defaults to 0. Required if a bitmap buffer is specified as <see cref="Buffer"/>.
1518
/// </summary>
1619
public int? Height { get; set; }
1720

1821
/// <summary>
19-
/// Gets or sets the scalefactor
22+
/// Gets or sets the image scale factor. Defaults to 1.0.
2023
/// </summary>
2124
public float ScaleFactor { get; set; } = 1.0f;
2225

2326
/// <summary>
24-
/// Gets or sets the buffer
27+
/// Gets or sets the buffer containing the raw image data.
2528
/// </summary>
2629
public byte[] Buffer { get; set; }
2730

2831
/// <summary>
29-
/// Gets or sets the dataURL
32+
/// Gets or sets the data URL containing a base 64 encoded PNG or JPEG image.
3033
/// </summary>
3134
public string DataUrl { get; set; }
3235
}

src/ElectronNET.API/API/Entities/AppDetailsOptions.cs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,36 @@
1-
namespace ElectronNET.API.Entities
1+
using System.Runtime.Versioning;
2+
3+
namespace ElectronNET.API.Entities
24
{
35
/// <summary>
46
///
57
/// </summary>
8+
/// <remarks>Up-to-date with Electron API 39.2</remarks>
9+
[SupportedOSPlatform("windows")]
610
public class AppDetailsOptions
711
{
812
/// <summary>
9-
/// Windows App User Model ID. It has to be set, otherwise the other options will have no effect.
13+
/// Window's App User Model ID. It has to be set, otherwise the other options will have no effect.
1014
/// </summary>
1115
public string AppId { get; set; }
1216

1317
/// <summary>
14-
/// Window’s Relaunch Icon.
18+
/// Window's relaunch icon resource path.
1519
/// </summary>
1620
public string AppIconPath { get; set; }
1721

1822
/// <summary>
19-
/// Index of the icon in appIconPath. Ignored when appIconPath is not set. Default is 0.
23+
/// Index of the icon in <see cref="AppIconPath"/>. Ignored when <see cref="AppIconPath"/> is not set. Default is 0.
2024
/// </summary>
2125
public int AppIconIndex { get; set; }
2226

2327
/// <summary>
24-
/// Window’s Relaunch Command.
28+
/// Window's relaunch command.
2529
/// </summary>
2630
public string RelaunchCommand { get; set; }
2731

2832
/// <summary>
29-
/// Window’s Relaunch Display Name.
33+
/// Window's relaunch display name.
3034
/// </summary>
3135
public string RelaunchDisplayName { get; set; }
3236
}

0 commit comments

Comments
 (0)