From 65e88318289911a3541439faa16697b29c705eb0 Mon Sep 17 00:00:00 2001 From: WINBIGFOX Date: Wed, 9 Jul 2025 15:30:23 +0200 Subject: [PATCH 1/6] fix: add default values for optional parameters in update auto-updater event classes (#597) --- src/Events/AutoUpdater/Error.php | 2 +- src/Events/AutoUpdater/UpdateAvailable.php | 8 ++++---- src/Events/AutoUpdater/UpdateCancelled.php | 8 ++++---- src/Events/AutoUpdater/UpdateDownloaded.php | 8 ++++---- src/Events/AutoUpdater/UpdateNotAvailable.php | 8 ++++---- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/Events/AutoUpdater/Error.php b/src/Events/AutoUpdater/Error.php index 9d2219d3..3e1c29e1 100644 --- a/src/Events/AutoUpdater/Error.php +++ b/src/Events/AutoUpdater/Error.php @@ -15,7 +15,7 @@ class Error implements ShouldBroadcastNow public function __construct( public string $name, public string $message, - public ?string $stack, + public ?string $stack = null, ) {} public function broadcastOn() diff --git a/src/Events/AutoUpdater/UpdateAvailable.php b/src/Events/AutoUpdater/UpdateAvailable.php index 1fb05fb7..dc5ab67a 100644 --- a/src/Events/AutoUpdater/UpdateAvailable.php +++ b/src/Events/AutoUpdater/UpdateAvailable.php @@ -16,10 +16,10 @@ public function __construct( public string $version, public array $files, public string $releaseDate, - public ?string $releaseName, - public string|array|null $releaseNotes, - public ?int $stagingPercentage, - public ?string $minimumSystemVersion, + public ?string $releaseName = null, + public string|array|null $releaseNotes = null, + public ?int $stagingPercentage = null, + public ?string $minimumSystemVersion = null, ) {} public function broadcastOn() diff --git a/src/Events/AutoUpdater/UpdateCancelled.php b/src/Events/AutoUpdater/UpdateCancelled.php index 09d01b69..77ae44fe 100644 --- a/src/Events/AutoUpdater/UpdateCancelled.php +++ b/src/Events/AutoUpdater/UpdateCancelled.php @@ -16,10 +16,10 @@ public function __construct( public string $version, public array $files, public string $releaseDate, - public ?string $releaseName, - public string|array|null $releaseNotes, - public ?int $stagingPercentage, - public ?string $minimumSystemVersion, + public ?string $releaseName = null, + public string|array|null $releaseNotes = null, + public ?int $stagingPercentage = null, + public ?string $minimumSystemVersion = null, ) {} public function broadcastOn() diff --git a/src/Events/AutoUpdater/UpdateDownloaded.php b/src/Events/AutoUpdater/UpdateDownloaded.php index 379d62fa..b5856f1d 100644 --- a/src/Events/AutoUpdater/UpdateDownloaded.php +++ b/src/Events/AutoUpdater/UpdateDownloaded.php @@ -17,10 +17,10 @@ public function __construct( public string $version, public array $files, public string $releaseDate, - public ?string $releaseName, - public string|array|null $releaseNotes, - public ?int $stagingPercentage, - public ?string $minimumSystemVersion + public ?string $releaseName = null, + public string|array|null $releaseNotes = null, + public ?int $stagingPercentage = null, + public ?string $minimumSystemVersion = null, ) {} public function broadcastOn() diff --git a/src/Events/AutoUpdater/UpdateNotAvailable.php b/src/Events/AutoUpdater/UpdateNotAvailable.php index c642d825..f357b0cb 100644 --- a/src/Events/AutoUpdater/UpdateNotAvailable.php +++ b/src/Events/AutoUpdater/UpdateNotAvailable.php @@ -16,10 +16,10 @@ public function __construct( public string $version, public array $files, public string $releaseDate, - public ?string $releaseName, - public string|array|null $releaseNotes, - public ?int $stagingPercentage, - public ?string $minimumSystemVersion, + public ?string $releaseName = null, + public string|array|null $releaseNotes = null, + public ?int $stagingPercentage = null, + public ?string $minimumSystemVersion = null, ) {} public function broadcastOn() From 5df3291f96dc9ff588def0f25052a065af42e9d5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Jul 2025 15:41:10 +0200 Subject: [PATCH 2/6] chore(deps): bump stefanzweifel/git-auto-commit-action from 5 to 6 (#622) Bumps [stefanzweifel/git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action) from 5 to 6. - [Release notes](https://github.com/stefanzweifel/git-auto-commit-action/releases) - [Changelog](https://github.com/stefanzweifel/git-auto-commit-action/blob/master/CHANGELOG.md) - [Commits](https://github.com/stefanzweifel/git-auto-commit-action/compare/v5...v6) --- updated-dependencies: - dependency-name: stefanzweifel/git-auto-commit-action dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/fix-php-code-style-issues.yml | 2 +- .github/workflows/update-changelog.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/fix-php-code-style-issues.yml b/.github/workflows/fix-php-code-style-issues.yml index 4ae67bf2..7c6a4c2d 100644 --- a/.github/workflows/fix-php-code-style-issues.yml +++ b/.github/workflows/fix-php-code-style-issues.yml @@ -37,7 +37,7 @@ jobs: - name: Commit changes if: github.event_name == 'pull_request' - uses: stefanzweifel/git-auto-commit-action@v5 + uses: stefanzweifel/git-auto-commit-action@v6 with: commit_message: Fix styling diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml index ec40921c..859924d6 100644 --- a/.github/workflows/update-changelog.yml +++ b/.github/workflows/update-changelog.yml @@ -24,7 +24,7 @@ jobs: release-notes: ${{ github.event.release.body }} - name: Commit updated CHANGELOG - uses: stefanzweifel/git-auto-commit-action@v5 + uses: stefanzweifel/git-auto-commit-action@v6 with: branch: main commit_message: Update CHANGELOG From 26d8402c49e724279d0ae9f0860fa07832e9a910 Mon Sep 17 00:00:00 2001 From: Simon Hamp Date: Fri, 11 Jul 2025 18:33:22 +0100 Subject: [PATCH 3/6] Printing: Allow settings to be passed in (#634) * Add settings * Allow settings on printToPDF too * Comments --- src/System.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/System.php b/src/System.php index da23025a..6eb2b289 100644 --- a/src/System.php +++ b/src/System.php @@ -62,18 +62,26 @@ public function printers(): array })->toArray(); } - public function print(string $html, ?Printer $printer = null): void + /** + * For $settings options, see https://www.electronjs.org/docs/latest/api/web-contents#contentsprintoptions-callback + */ + public function print(string $html, ?Printer $printer = null, ?array $settings = []): void { $this->client->post('system/print', [ 'html' => $html, 'printer' => $printer->name ?? '', + 'settings' => $settings, ]); } - public function printToPDF(string $html): string + /** + * For $settings options, see https://www.electronjs.org/docs/latest/api/web-contents#contentsprinttopdfoptions + */ + public function printToPDF(string $html, ?array $settings = []): string { return $this->client->post('system/print-to-pdf', [ 'html' => $html, + 'settings' => $settings, ])->json('result'); } From 5f6b9d1a54d7900eacd27da2d71c6a5287f6881e Mon Sep 17 00:00:00 2001 From: Brian Faust Date: Sat, 26 Jul 2025 14:20:56 +0300 Subject: [PATCH 4/6] feat: add Azure Trusted Signing support (#658) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add Azure Trusted Signing support Add configuration for Azure Trusted Signing service for Windows code signing. This includes credential settings and environment variable cleanup for Azure-related keys. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * style: reorganize imports in DebugCommand 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --------- Co-authored-by: Claude --- config/nativephp-internal.php | 13 +++++++++++++ config/nativephp.php | 5 +++++ src/Commands/DebugCommand.php | 9 +++++++++ 3 files changed, 27 insertions(+) diff --git a/config/nativephp-internal.php b/config/nativephp-internal.php index bb7dbf23..186fbcfc 100644 --- a/config/nativephp-internal.php +++ b/config/nativephp-internal.php @@ -48,6 +48,19 @@ 'apple_team_id' => env('NATIVEPHP_APPLE_TEAM_ID'), ], + /** + * The credentials to use Azure Trusted Signing service. + */ + 'azure_trusted_signing' => [ + 'tenant_id' => env('AZURE_TENANT_ID'), + 'client_id' => env('AZURE_CLIENT_ID'), + 'client_secret' => env('AZURE_CLIENT_SECRET'), + 'publisher_name' => env('NATIVEPHP_AZURE_PUBLISHER_NAME'), + 'endpoint' => env('NATIVEPHP_AZURE_ENDPOINT'), + 'certificate_profile_name' => env('NATIVEPHP_AZURE_CERTIFICATE_PROFILE_NAME'), + 'code_signing_account_name' => env('NATIVEPHP_AZURE_CODE_SIGNING_ACCOUNT_NAME'), + ], + /** * The binary path of PHP for NativePHP to use at build. */ diff --git a/config/nativephp.php b/config/nativephp.php index d68245fc..91938bd9 100644 --- a/config/nativephp.php +++ b/config/nativephp.php @@ -60,6 +60,7 @@ */ 'cleanup_env_keys' => [ 'AWS_*', + 'AZURE_*', 'GITHUB_*', 'DO_SPACES_*', '*_SECRET', @@ -68,6 +69,10 @@ 'NATIVEPHP_APPLE_ID', 'NATIVEPHP_APPLE_ID_PASS', 'NATIVEPHP_APPLE_TEAM_ID', + 'NATIVEPHP_AZURE_PUBLISHER_NAME', + 'NATIVEPHP_AZURE_ENDPOINT', + 'NATIVEPHP_AZURE_CERTIFICATE_PROFILE_NAME', + 'NATIVEPHP_AZURE_CODE_SIGNING_ACCOUNT_NAME', ], /** diff --git a/src/Commands/DebugCommand.php b/src/Commands/DebugCommand.php index 504ef7ba..4b8e2464 100644 --- a/src/Commands/DebugCommand.php +++ b/src/Commands/DebugCommand.php @@ -111,6 +111,14 @@ private function processNativePHP(): static && config('nativephp-internal.notarization.apple_id_pass') && config('nativephp-internal.notarization.apple_team_id'); + $isAzureTrustedSigningConfigured = config('nativephp-internal.azure_trusted_signing.tenant_id') + && config('nativephp-internal.azure_trusted_signing.client_id') + && config('nativephp-internal.azure_trusted_signing.client_secret') + && config('nativephp-internal.azure_trusted_signing.publisher_name') + && config('nativephp-internal.azure_trusted_signing.endpoint') + && config('nativephp-internal.azure_trusted_signing.certificate_profile_name') + && config('nativephp-internal.azure_trusted_signing.code_signing_account_name'); + $this->debugInfo->put( 'NativePHP', [ @@ -122,6 +130,7 @@ private function processNativePHP(): static 'Post' => config('nativephp.postbuild'), ], 'NotarizationEnabled' => $isNotarizationConfigured, + 'AzureTrustedSigningEnabled' => $isAzureTrustedSigningConfigured, 'CustomPHPBinary' => config('nativephp-internal.php_binary_path') ?? false, ], ] From 86f9b87536c23ed416c235d2b6827e190af7f634 Mon Sep 17 00:00:00 2001 From: Simon Hamp Date: Sat, 26 Jul 2025 10:18:07 -0400 Subject: [PATCH 5/6] Update funding.yml --- .github/funding.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/funding.yml b/.github/funding.yml index 23b9601c..f91f9af1 100644 --- a/.github/funding.yml +++ b/.github/funding.yml @@ -1,2 +1 @@ -github: simonhamp open_collective: nativephp From 79762601f6db83210a70366088cacd61fa05abf5 Mon Sep 17 00:00:00 2001 From: WINBIGFOX Date: Mon, 4 Aug 2025 19:24:43 +0200 Subject: [PATCH 6/6] add `skipTaskbar` and `hiddenInMissionControl` window options (#671) Introduced `skipTaskbar` and `hiddenInMissionControl` methods to configure window behavior. Updated `toArray` to include these new properties and extended tests to validate functionality. --- src/Windows/Window.php | 20 ++++++++++++++++++++ tests/Windows/WindowTest.php | 4 ++++ 2 files changed, 24 insertions(+) diff --git a/src/Windows/Window.php b/src/Windows/Window.php index 7eadd248..92af58b5 100644 --- a/src/Windows/Window.php +++ b/src/Windows/Window.php @@ -44,6 +44,10 @@ class Window protected bool $focusable = true; + protected bool $skipTaskbar = false; + + protected bool $hiddenInMissionControl = false; + protected bool $focused = false; protected bool $hasShadow = true; @@ -157,6 +161,20 @@ public function focusable($value = true): self return $this; } + public function skipTaskbar($value = true): self + { + $this->skipTaskbar = $value; + + return $this; + } + + public function hiddenInMissionControl($value = true): self + { + $this->hiddenInMissionControl = $value; + + return $this; + } + public function hasShadow($value = true): self { $this->hasShadow = $value; @@ -323,6 +341,8 @@ public function toArray() 'maxWidth' => $this->maxWidth, 'maxHeight' => $this->maxHeight, 'focusable' => $this->focusable, + 'skipTaskbar' => $this->skipTaskbar, + 'hiddenInMissionControl' => $this->hiddenInMissionControl, 'hasShadow' => $this->hasShadow, 'frame' => $this->frame, 'titleBarStyle' => $this->titleBarStyle, diff --git a/tests/Windows/WindowTest.php b/tests/Windows/WindowTest.php index 8cf21d6a..cabfde71 100644 --- a/tests/Windows/WindowTest.php +++ b/tests/Windows/WindowTest.php @@ -16,6 +16,8 @@ ->titleBarStyle('milwad') ->rememberState() ->frameless() + ->skipTaskbar() + ->hiddenInMissionControl() ->focusable() ->hasShadow() ->alwaysOnTop() @@ -36,6 +38,8 @@ expect($windowArray['titleBarStyle'])->toBe('milwad'); expect($windowArray['rememberState'])->toBeTrue(); expect($windowArray['frame'])->toBeFalse(); + expect($windowArray['skipTaskbar'])->toBeTrue(); + expect($windowArray['hiddenInMissionControl'])->toBeTrue(); expect($windowArray['focusable'])->toBeTrue(); expect($windowArray['hasShadow'])->toBeTrue(); expect($windowArray['alwaysOnTop'])->toBeTrue();