Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 0 additions & 107 deletions .github/workflows/Sign-WithKeyLocker.ps1

This file was deleted.

79 changes: 66 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,19 +219,72 @@ jobs:
shell: bash
run: security delete-keychain "${{ steps.signing_keychain.outputs.keychain_path }}" || true

# Windows Authenticode signing via DigiCert KeyLocker is temporarily
# disabled — tracked in DEVEX-1081. No SM_HOST/SM_API_KEY/etc. secrets
# or ENABLE_WINDOWS_SIGNING/KEYLOCKER_KEYPAIR_ALIAS vars exist on this
# repo yet. Re-enable once those land (see .github/workflows/Sign-WithKeyLocker.ps1).
# - name: Sign gddy.exe (DigiCert KeyLocker)
# if: matrix.os == 'windows-latest' && vars.ENABLE_WINDOWS_SIGNING == '1'
# shell: pwsh
# env:
# SM_HOST: ${{ secrets.SM_HOST }}
# SM_API_KEY: ${{ secrets.SM_API_KEY }}
# SM_CLIENT_CERT_PASSWORD: ${{ secrets.SM_CLIENT_CERT_PASSWORD }}
# SM_CLIENT_CERT_FILE_B64: ${{ secrets.SM_CLIENT_CERT_FILE }}
# run: ../.github/workflows/Sign-WithKeyLocker.ps1 -Path "target/${{ matrix.target }}/release/gddy.exe" -KeypairAlias "${{ vars.KEYLOCKER_KEYPAIR_ALIAS }}"
# Windows Authenticode signing via DigiCert KeyLocker (DEVEX-1081). All
# four steps are skipped unless the repo variable ENABLE_WINDOWS_SIGNING
# is set to 1. Configuration:
# secrets SM_API_KEY, SM_CLIENT_CERT_PASSWORD, and SM_CLIENT_CERT_FILE
# (base64 of the KeyLocker client-authentication .p12)
# variables SM_HOST (KeyLocker client-auth host), KEYLOCKER_KEYPAIR_ALIAS
- name: Prepare KeyLocker client certificate (Windows)
if: matrix.os == 'windows-latest' && vars.ENABLE_WINDOWS_SIGNING == '1'
shell: pwsh
env:
SM_CLIENT_CERT_B64: ${{ secrets.SM_CLIENT_CERT_FILE }}
SM_API_KEY: ${{ secrets.SM_API_KEY }}
SM_CLIENT_CERT_PASSWORD: ${{ secrets.SM_CLIENT_CERT_PASSWORD }}
SM_HOST: ${{ vars.SM_HOST }}
KEYLOCKER_KEYPAIR_ALIAS: ${{ vars.KEYLOCKER_KEYPAIR_ALIAS }}
run: |
Comment thread
jpage-godaddy marked this conversation as resolved.
Resolved
# Fail up front, naming everything that is missing, instead of
# failing later inside the base64 decode or the signing action.
$missing = @('SM_API_KEY', 'SM_CLIENT_CERT_PASSWORD', 'SM_HOST', 'KEYLOCKER_KEYPAIR_ALIAS') |
Where-Object { [string]::IsNullOrWhiteSpace([Environment]::GetEnvironmentVariable($_)) }
if ([string]::IsNullOrWhiteSpace($env:SM_CLIENT_CERT_B64)) { $missing += 'SM_CLIENT_CERT_FILE' }
if ($missing) {
Write-Host "::error::Windows signing is enabled (ENABLE_WINDOWS_SIGNING=1) but these secrets/variables are not set: $($missing -join ', '). Set them in the repository settings, or set ENABLE_WINDOWS_SIGNING to 0 to skip signing."
exit 1
}
try {
$bytes = [Convert]::FromBase64String($env:SM_CLIENT_CERT_B64)
} catch {
Write-Host '::error::The SM_CLIENT_CERT_FILE secret is not valid base64. It must be the base64 encoding of the client certificate .p12 file.'
exit 1
}
$p12 = Join-Path $env:RUNNER_TEMP 'keylocker-client.p12'
[IO.File]::WriteAllBytes($p12, $bytes)
"SM_CLIENT_CERT_FILE=$p12" >> $env:GITHUB_ENV

# The action silently skips signing when `input` or `keypair-alias` is
# empty. The step above checks the alias; the verify step below catches
# anything else that leaves the binary unsigned.
- name: Sign gddy.exe (DigiCert KeyLocker)
if: matrix.os == 'windows-latest' && vars.ENABLE_WINDOWS_SIGNING == '1'
uses: digicert/code-signing-software-trust-action@fae23a455ba4bde62b64fd7cb2f81ade788f5a95 # v1.2.1
with:
simple-signing-mode: true
keypair-alias: ${{ vars.KEYLOCKER_KEYPAIR_ALIAS }}
input: ${{ github.workspace }}\rust\target\${{ matrix.target }}\release\gddy.exe
env:
SM_HOST: ${{ vars.SM_HOST }}
SM_API_KEY: ${{ secrets.SM_API_KEY }}
SM_CLIENT_CERT_FILE: ${{ env.SM_CLIENT_CERT_FILE }}
SM_CLIENT_CERT_PASSWORD: ${{ secrets.SM_CLIENT_CERT_PASSWORD }}

- name: Verify gddy.exe signature (Windows)
if: matrix.os == 'windows-latest' && vars.ENABLE_WINDOWS_SIGNING == '1'
shell: pwsh
run: |
# signtool ships with the Windows SDK on the runner but is not on PATH.
$signtool = Get-ChildItem 'C:\Program Files (x86)\Windows Kits\10\bin\*\x64\signtool.exe' -ErrorAction SilentlyContinue |
Sort-Object FullName -Descending | Select-Object -First 1
if (-not $signtool) { throw 'signtool.exe not found in the Windows SDK.' }
& $signtool.FullName verify /pa /v "target/${{ matrix.target }}/release/gddy.exe"
if ($LASTEXITCODE -ne 0) { throw "signtool verify failed ($LASTEXITCODE)." }

- name: Remove KeyLocker client certificate (Windows)
if: always() && matrix.os == 'windows-latest' && vars.ENABLE_WINDOWS_SIGNING == '1'
shell: pwsh
run: Remove-Item (Join-Path $env:RUNNER_TEMP 'keylocker-client.p12') -ErrorAction SilentlyContinue

- name: Package gddy
shell: bash
Expand Down
Loading