@@ -442,16 +442,44 @@ jobs:
442442 name : salt-${{ inputs.salt-version }}-onedir-windows-${{ matrix.arch }}.zip
443443 path : artifacts/
444444
445- - name : Code signing with Software Trust Manager
446- if : ${{ steps.check-pkg-sign.outputs.sign-pkgs == 'true' }}
447- 448-
449445 - name : Setup Certificate
450446 if : ${{ steps.check-pkg-sign.outputs.sign-pkgs == 'true' }}
451447 shell : bash
452448 run : |
453449 echo "${{ secrets.WIN_SIGN_CERT_FILE_B64 }}" | base64 --decode > /d/Certificate_pkcs12.p12
454450
451+ - name : Code signing with Software Trust Manager
452+ if : ${{ steps.check-pkg-sign.outputs.sign-pkgs == 'true' }}
453+ shell : powershell
454+ command : |
455+ # Navigate to C: drive
456+ Set-Location C:\
457+
458+ # Check if the file exists in the user's home directory
459+ $filePath = Join-Path $env:USERPROFILE 'smtools-windows-x64.msi'
460+ if (Test-Path $filePath) {
461+ Write-Host "File exists. Moving to C:"
462+ Copy-Item $filePath -Destination .\
463+ }
464+ else {
465+ Write-Host "No existing file found. Downloading..."
466+ # Download the file using Invoke-WebRequest
467+ curl.exe -X GET https://one.digicert.com/signingmanager/api-ui/v1/releases/smtools-windows-x64.msi/download -H "x-api-key:$env:SM_API_KEY" -o smtools-windows-x64.msi
468+ # Copy the downloaded file to the user's home directory
469+ Copy-Item 'smtools-windows-x64.msi' -Destination $env:USERPROFILE
470+ }
471+
472+ # Execute the MSI installer
473+ msiexec.exe /i smtools-windows-x64.msi /quiet /qn | Wait-Process
474+ & 'C:\Program Files\DigiCert\DigiCert One Signing Manager Tools\smksp_cert_sync.exe'
475+
476+ # Manual resync
477+ & 'C:\Program Files\DigiCert\DigiCert One Signing Manager Tools\smctl.exe' windows certsync
478+
479+ # - name: Code signing with Software Trust Manager
480+ # if: ${{ steps.check-pkg-sign.outputs.sign-pkgs == 'true' }}
481+ # uses: digicert/[email protected] 482+
455483 - name : Build Windows Packages
456484 run : |
457485 tools pkg build windows --relenv-version=${{ inputs.relenv-version }} --python-version=${{ inputs.python-version }} ${{
0 commit comments