Add dummy pierre-test-windows-code-sign, plus console log on normal script
This commit is contained in:
		
							
								
								
									
										46
									
								
								.github/workflows/pierre-test-windows-code-sign.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								.github/workflows/pierre-test-windows-code-sign.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,46 @@ | |||||||
|  | name: pierre-test-windows-code-sign | ||||||
|  |  | ||||||
|  | on: | ||||||
|  |   push: | ||||||
|  |     branches: | ||||||
|  |       - pierremtb/issue6256-Updater-on-Nightly-on-Windows-failed | ||||||
|  |  | ||||||
|  | jobs: | ||||||
|  |   build-apps: | ||||||
|  |     strategy: | ||||||
|  |       fail-fast: false | ||||||
|  |       matrix: | ||||||
|  |         include: | ||||||
|  |           - os: windows-2022 | ||||||
|  |             platform: win | ||||||
|  |     runs-on: ${{ matrix.os }} | ||||||
|  |     steps: | ||||||
|  |       # The next two steps are from the official Digicert docs, available at | ||||||
|  |       # https://docs.digicert.com/en/digicert-keylocker/ci-cd-integrations/scripts/github/scripts-for-signing-using-ksp-library-on-github.html#ksp-signing-using-github-action-488726 | ||||||
|  |       # EXCEPT the `smksp_registrar.exe register` line | ||||||
|  |       # EXCEPT the `certutil.exe -csp "DigiCert Software Trust Manager KSP" -key -user` line | ||||||
|  |       - name: Prepare certificate and variables (Windows only) | ||||||
|  |         run: | | ||||||
|  |           echo "${{ secrets.SM_CLIENT_CERT_FILE_B64 }}" | base64 --decode > /d/Certificate_pkcs12.p12 | ||||||
|  |           echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | ||||||
|  |           echo "KEYPAIR_NAME=gt-standard-keypair" >> $GITHUB_OUTPUT | ||||||
|  |           echo "CERTIFICATE_NAME=gt-certificate" >> $GITHUB_OUTPUT | ||||||
|  |           echo "SM_HOST=${{ secrets.SM_HOST }}" >> "$GITHUB_ENV" | ||||||
|  |           echo "SM_API_KEY=${{ secrets.SM_API_KEY }}" >> "$GITHUB_ENV" | ||||||
|  |           echo "SM_CLIENT_CERT_FILE=D:\\Certificate_pkcs12.p12" >> "$GITHUB_ENV" | ||||||
|  |           echo "SM_CLIENT_CERT_PASSWORD=${{ secrets.SM_CLIENT_CERT_PASSWORD }}" >> "$GITHUB_ENV" | ||||||
|  |           echo "C:\Program Files (x86)\Windows Kits\10\App Certification Kit" >> $GITHUB_PATH | ||||||
|  |           echo "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools" >> $GITHUB_PATH | ||||||
|  |           echo "C:\Program Files\DigiCert\DigiCert Keylocker Tools" >> $GITHUB_PATH | ||||||
|  |         shell: bash | ||||||
|  |  | ||||||
|  |       - name: Setup certicate with SSM KSP (Windows only) | ||||||
|  |         run: | | ||||||
|  |           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 | ||||||
|  |           msiexec /i Keylockertools-windows-x64.msi /quiet /qn | ||||||
|  |           smksp_registrar.exe register | ||||||
|  |           smksp_registrar.exe list | ||||||
|  |           smctl.exe keypair ls | ||||||
|  |           C:\Windows\System32\certutil.exe -csp "DigiCert Software Trust Manager KSP" -key -user | ||||||
|  |           smksp_cert_sync.exe | ||||||
|  |         shell: cmd | ||||||
| @ -23,10 +23,11 @@ exports.default = async (configuration) => { | |||||||
|   } |   } | ||||||
|  |  | ||||||
|   try { |   try { | ||||||
|     execSync( |     const result = execSync( | ||||||
|       `smctl sign --fingerprint="${process.env.WINDOWS_CERTIFICATE_THUMBPRINT |       `smctl sign --fingerprint="${process.env.WINDOWS_CERTIFICATE_THUMBPRINT | ||||||
|       }" --input "${String(configuration.path)}"`, |       }" --input "${String(configuration.path)}"`, | ||||||
|     ) |     ).toString() | ||||||
|  |     console.log('execSync result', result) | ||||||
|     console.log('Signing using signWin.js script: successful') |     console.log('Signing using signWin.js script: successful') | ||||||
|   } catch (error) { |   } catch (error) { | ||||||
|     throw new Error('Signing using signWin.js script: failed:', error) |     throw new Error('Signing using signWin.js script: failed:', error) | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user