authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-05-08 12:35:52-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-05-08 12:35:52-07:00
log073eb389d3b831ea3622fbb1a98a9fea6454a6ba
tree6d5725b5aafdf56903912fb0586c36ad1dd4a3ea
parent825263b6f979e24bc7cd48a8ea0bdf18c27b58fa
signature Signed by PGP key B5690EEEBB952194

[codex] Fix Windows release signing setup (#2606)

Co-authored-by: Julius Marminge <julius@macmini.local>

1 files changed, 56 insertions(+), 0 deletions(-)

.github/workflows/release.yml+56
......@@ -244,6 +244,62 @@ jobs:
244244 exit $code
245245 }
246246
247 - name: Prepare Azure Trusted Signing
248 if: matrix.platform == 'win'
249 shell: pwsh
250 env:
251 AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
252 AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
253 AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
254 AZURE_TRUSTED_SIGNING_ENDPOINT: ${{ secrets.AZURE_TRUSTED_SIGNING_ENDPOINT }}
255 AZURE_TRUSTED_SIGNING_ACCOUNT_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_ACCOUNT_NAME }}
256 AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME }}
257 AZURE_TRUSTED_SIGNING_PUBLISHER_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_PUBLISHER_NAME }}
258 run: |
259 $ErrorActionPreference = "Stop"
260
261 $requiredSecrets = @(
262 $env:AZURE_TENANT_ID,
263 $env:AZURE_CLIENT_ID,
264 $env:AZURE_CLIENT_SECRET,
265 $env:AZURE_TRUSTED_SIGNING_ENDPOINT,
266 $env:AZURE_TRUSTED_SIGNING_ACCOUNT_NAME,
267 $env:AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME,
268 $env:AZURE_TRUSTED_SIGNING_PUBLISHER_NAME
269 )
270 if ($requiredSecrets | Where-Object { [string]::IsNullOrWhiteSpace($_) }) {
271 Write-Host "Azure Trusted Signing disabled; skipping TrustedSigning module preparation."
272 exit 0
273 }
274
275 Install-PackageProvider `
276 -Name NuGet `
277 -MinimumVersion 2.8.5.201 `
278 -Force `
279 -Scope CurrentUser
280
281 Install-Module `
282 -Name TrustedSigning `
283 -MinimumVersion 0.5.0 `
284 -Force `
285 -AllowClobber `
286 -Repository PSGallery `
287 -Scope CurrentUser
288
289 Import-Module TrustedSigning -MinimumVersion 0.5.0 -Force
290 Get-Command Invoke-TrustedSigning -ErrorAction Stop
291
292 $moduleRoots = @(
293 [System.IO.Path]::Combine([Environment]::GetFolderPath("MyDocuments"), "PowerShell", "Modules"),
294 [System.IO.Path]::Combine([Environment]::GetFolderPath("MyDocuments"), "WindowsPowerShell", "Modules"),
295 [System.IO.Path]::Combine($env:ProgramFiles, "PowerShell", "Modules"),
296 [System.IO.Path]::Combine($env:ProgramFiles, "WindowsPowerShell", "Modules")
297 )
298 $modulePathEntries = @($moduleRoots + ($env:PSModulePath -split ";")) |
299 Where-Object { $_ -and (Test-Path $_) } |
300 Select-Object -Unique
301 "PSModulePath=$($modulePathEntries -join ';')" >> $env:GITHUB_ENV
302
247303 - name: Build desktop artifact
248304 shell: bash
249305 env: