@@ -296,7 +296,7 @@ jobs:
296
296
run : |
297
297
set -ex
298
298
set -o pipefail
299
-
299
+
300
300
root=$PWD
301
301
302
302
mkdir -pv $root/packaged-deb
@@ -654,31 +654,32 @@ jobs:
654
654
make out/cf-cli_win32.exe
655
655
make out/cf-cli_winx64.exe
656
656
657
- - name : write windows cert
658
- env :
659
- SIGNING_KEY_WINDOWS_PASSPHRASE : ${{ secrets.SIGNING_KEY_WINDOWS_PASSPHRASE }}
660
- SIGNING_KEY_WINDOWS_PFX : ${{ secrets.SIGNING_KEY_WINDOWS_PFX }}
657
+ - name : Set up certificate
661
658
run : |
662
- $pass = convertto-securestring -string "${env:SIGNING_KEY_WINDOWS_PASSPHRASE}" -asplaintext
663
- [convert]::frombase64string(${env:SIGNING_KEY_WINDOWS_PFX}) | set-content -path $env:runner_temp\cert.pfx -asbytestream
664
-
659
+ echo "${{ secrets.SIGNING_KEY_WINDOWS_DIGICERT_CLIENT_CERT_B64 }}" | base64 --decode > /d/Certificate_pkcs12.p12
660
+ shell : bash
665
661
666
- - name : Sign windows binaries
667
- env :
668
- SIGNING_KEY_WINDOWS_PASSPHRASE : ${{ secrets.SIGNING_KEY_WINDOWS_PASSPHRASE }}
669
- run : |
670
- .\.github\win\sign-windows-binary.ps1 -BinaryFilePath out\cf-cli_win32.exe
671
- .\.github\win\sign-windows-binary.ps1 -BinaryFilePath out\cf-cli_winx64.exe
672
-
673
- - name : View binary signatures
662
+ - name : Set variables
663
+ id : variables
674
664
run : |
675
- Get-AuthenticodeSignature -Verbose -ErrorAction Stop .\out\cf-cli_win32.exe
676
- Get-AuthenticodeSignature -Verbose -ErrorAction Stop .\out\cf-cli_winx64.exe
677
-
678
- - name : Make symlinks
665
+ echo "SM_HOST=${{ vars.SIGNING_KEY_WINDOWS_DIGICERT_HOST }}" >> "$GITHUB_ENV"
666
+ echo "SM_API_KEY=${{ secrets.SIGNING_KEY_WINDOWS_DIGICERT_API_KEY }}" >> "$GITHUB_ENV"
667
+ echo "SM_CLIENT_CERT_FILE=D:\\Certificate_pkcs12.p12" >> "$GITHUB_ENV"
668
+ echo "SM_CLIENT_CERT_PASSWORD=${{ secrets.SIGNING_KEY_WINDOWS_DIGICERT_CLIENT_CERT_INSTALLATION_PASSWORD }}" >> "$GITHUB_ENV"
669
+ echo "C:\Program Files (x86)\Windows Kits\10\App Certification Kit" >> $GITHUB_PATH
670
+ echo "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools" >> $GITHUB_PATH
671
+ echo "C:\Program Files\DigiCert\DigiCert Keylocker Tools" >> $GITHUB_PATH
672
+ shell : bash
673
+
674
+ - name : Setup Keylocker KSP on Windows
679
675
run : |
680
- New-Item -ItemType SymbolicLink -Target .\out\cf-cli_win32.exe -Path .\out\cf-cli_win32-link.exe
681
- New-Item -ItemType SymbolicLink -Target .\out\cf-cli_winx64.exe -Path .\out\cf-cli_winx64-link.exe
676
+ curl -X GET https://one.digicert.com/signingmanager/api-ui/v1/releases/Keylockertools-windows-x64.msi/download -H "x-api-key:%SM_API_KEY%" -o Keylockertools-windows-x64.msi
677
+ msiexec /i Keylockertools-windows-x64.msi /quiet /qn
678
+ smksp_registrar.exe list
679
+ smctl.exe keypair ls
680
+ C:\Windows\System32\certutil.exe -csp "DigiCert Signing Manager KSP" -key -user
681
+ smctl windows certsync
682
+ shell : cmd
682
683
683
684
# This is for debugging windows
684
685
# - name: enable ssh
@@ -698,6 +699,22 @@ jobs:
698
699
# sleep 3600
699
700
# Stop-Service sshd
700
701
702
+ - name : Sign Windows binaries
703
+ run : |
704
+ smctl healthcheck --all
705
+ smctl sign --fingerprint ${{ secrets.SIGNING_KEY_WINDOWS_DIGICERT_CERT_FINGERPRINT }} --tool signtool --input out\cf-cli_win32.exe
706
+ smctl sign --fingerprint ${{ secrets.SIGNING_KEY_WINDOWS_DIGICERT_CERT_FINGERPRINT }} --tool signtool --input out\cf-cli_winx64.exe
707
+
708
+ - name : View binary signatures
709
+ run : |
710
+ Get-AuthenticodeSignature -Verbose -ErrorAction Stop .\out\cf-cli_win32.exe
711
+ Get-AuthenticodeSignature -Verbose -ErrorAction Stop .\out\cf-cli_winx64.exe
712
+
713
+ - name : Make symlinks
714
+ run : |
715
+ New-Item -ItemType SymbolicLink -Target .\out\cf-cli_win32.exe -Path .\out\cf-cli_win32-link.exe
716
+ New-Item -ItemType SymbolicLink -Target .\out\cf-cli_winx64.exe -Path .\out\cf-cli_winx64-link.exe
717
+
701
718
- name : Save signed binaries as a GitHub Action Artifact
702
719
uses : actions/upload-artifact@v4
703
720
with :
@@ -715,36 +732,34 @@ jobs:
715
732
mkdir "${env:RUNNER_TEMP}\win32"
716
733
.\.github\win\run-innosetup.ps1 -InnoSetupConfig ".github\win\windows-installer-v${env:VERSION_MAJOR}-x86.iss" -CfBinary "out\cf-cli_win32.exe" -InstallerOutput "${env:RUNNER_TEMP}\win32\cf${env:VERSION_MAJOR}_installer.exe"
717
734
718
- - name : Sign windows installer
719
- env :
720
- SIGNING_KEY_WINDOWS_PASSPHRASE : ${{ secrets.SIGNING_KEY_WINDOWS_PASSPHRASE }}
735
+ - name : Sign Windows installers
721
736
run : |
722
- .\.github\win\ sign-windows-binary.ps1 -BinaryFilePath "${env:RUNNER_TEMP}\winx64 \cf${env:VERSION_MAJOR}_installer.exe"
723
- .\.github\win\ sign-windows-binary.ps1 -BinaryFilePath "${env:RUNNER_TEMP}\win32 \cf${env:VERSION_MAJOR}_installer.exe"
737
+ smctl sign --fingerprint ${{ secrets.SIGNING_KEY_WINDOWS_DIGICERT_CERT_FINGERPRINT }} --tool signtool --input "${env:RUNNER_TEMP}\win32 \cf${env:VERSION_MAJOR}_installer.exe"
738
+ smctl sign --fingerprint ${{ secrets.SIGNING_KEY_WINDOWS_DIGICERT_CERT_FINGERPRINT }} --tool signtool --input "${env:RUNNER_TEMP}\winx64 \cf${env:VERSION_MAJOR}_installer.exe"
724
739
725
740
- name : View installer signature
726
741
run : |
727
- Get-AuthenticodeSignature -Verbose -ErrorAction Stop "${env:RUNNER_TEMP}\winx64\cf${env:VERSION_MAJOR}_installer.exe"
728
742
Get-AuthenticodeSignature -Verbose -ErrorAction Stop "${env:RUNNER_TEMP}\win32\cf${env:VERSION_MAJOR}_installer.exe"
743
+ Get-AuthenticodeSignature -Verbose -ErrorAction Stop "${env:RUNNER_TEMP}\winx64\cf${env:VERSION_MAJOR}_installer.exe"
729
744
730
745
- name : Arrange files for upload
731
746
# note the -Path flag takes comma-delimited args
732
747
run : |
733
- Copy-Item -Destination "${env:RUNNER_TEMP}\winx64" -Path .github\win\LICENSE,.github\win\NOTICE
734
748
Copy-Item -Destination "${env:RUNNER_TEMP}\win32" -Path .github\win\LICENSE,.github\win\NOTICE
749
+ Copy-Item -Destination "${env:RUNNER_TEMP}\winx64" -Path .github\win\LICENSE,.github\win\NOTICE
735
750
736
- - name : Zip windows artifact
751
+ - name : Zip Windows artifact
737
752
run : |
738
753
# strip leading v to go from tag -> semver
739
754
$installer_release_version="$(cat BUILD_VERSION)".Replace("v", "")
740
- pushd "${env:RUNNER_TEMP}\winx64"
741
- $installer_zip_filename="${env:RUNNER_TEMP}\cf${env:VERSION_MAJOR}-cli-installer_${installer_release_version}_winx64.zip"
742
- Compress-Archive -DestinationPath "$installer_zip_filename" -Path *
743
- popd
744
755
pushd "${env:RUNNER_TEMP}\win32"
745
756
$installer_zip_filename="${env:RUNNER_TEMP}\cf${env:VERSION_MAJOR}-cli-installer_${installer_release_version}_win32.zip"
746
757
Compress-Archive -DestinationPath "$installer_zip_filename" -Path *
747
758
popd
759
+ pushd "${env:RUNNER_TEMP}\winx64"
760
+ $installer_zip_filename="${env:RUNNER_TEMP}\cf${env:VERSION_MAJOR}-cli-installer_${installer_release_version}_winx64.zip"
761
+ Compress-Archive -DestinationPath "$installer_zip_filename" -Path *
762
+ popd
748
763
Get-ChildItem "${env:RUNNER_TEMP}"
749
764
750
765
# - name: Setup tmate session
0 commit comments