Skip to content

never forget to compile! #33

never forget to compile!

never forget to compile! #33

Workflow file for this run

on: push
name: Testing action
jobs:
run_action:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Copy libraries
shell: cmd
run: |
mkdir files
copy C:\Windows\System32\wmi.dll files
cd files
mkdir subdirectory
copy C:\Windows\System32\wmi.dll subdirectory
- name: Generate test certificate
id: generate-cert
shell: pwsh
run: |
$cert = New-SelfSignedCertificate -Type CodeSigningCert -KeyUsageProperty Sign -KeyUsage DigitalSignature `
-KeyExportPolicy ExportableEncrypted -KeyProtection None -KeyAlgorithm RSA -KeyLength 2048 `
-KeyDescription "Certificate to test code signing action" -FriendlyName "TestCert" -Subject "E=do@not.use,CN=Test Certificate" `
-CertStoreLocation "Cert:\CurrentUser\My\"
$password = 'ThisIsASuperLongPassword'
$securedPwd = ConvertTo-SecureString -String $password -Force -AsPlainText
$pfxFile = 'testCert.pfx'
Export-PfxCertificate -FilePath $pfxFile -Password $securedPwd -Cert "Cert:\CurrentUser\My\$($cert.Thumbprint)" -Force
$base64PfxCert = [convert]::ToBase64String((Get-Content -path $pfxFile -AsByteStream))
echo "certificate=${base64PfxCert}" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
echo "certSha1=$($cert.Thumbprint)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
echo "certPassword=${password}" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
- name: Run the action
uses: ./
with:
certificate: '${{ steps.generate-cert.outputs.certificate }}'
certificatesha1: '${{ steps.generate-cert.outputs.certSha1 }}'
password: '${{ steps.generate-cert.outputs.certPassword }}'
folder: 'files'
recursive: true