Skip to content

Commit

Permalink
chore: Update build process to generate dev certificate and use envir…
Browse files Browse the repository at this point in the history
…onment variables for certificate path and password
  • Loading branch information
Thavarshan committed Aug 31, 2024
1 parent 3e9cd19 commit 74ab437
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ jobs:
}
shell: pwsh

- name: Generate Dev Certificate
run: |
$certPassword = [guid]::NewGuid().ToString()
$certPath = "$(Get-Location)\devcert.pfx"
$cert = New-SelfSignedCertificate -DnsName "CN=DevCert" -CertStoreLocation "Cert:\CurrentUser\My" -NotAfter (Get-Date).AddYears(1)
Export-PfxCertificate -Cert $cert -FilePath $certPath -Password (ConvertTo-SecureString -String $certPassword -Force -AsPlainText)
echo "CERT_PATH=$certPath" >> $GITHUB_ENV
echo "CERT_PASSWORD=$certPassword" >> $GITHUB_ENV
shell: pwsh

- name: Print Windows Kit Path
run: |
echo "Windows Kit Path: $env:WINDOWS_KIT_PATH"
Expand All @@ -47,4 +57,5 @@ jobs:
run: npm run make
env:
WINDOWS_KIT_PATH: ${{ env.WINDOWS_KIT_PATH }}
CERT_PASSWORD: ${{ secrets.CERT_PASSWORD }}
CERT_PATH: ${{ env.CERT_PATH }}
CERT_PASSWORD: ${{ env.CERT_PASSWORD }}
2 changes: 2 additions & 0 deletions forge.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ const config: ForgeConfig = {
packageDescription: 'A simple video converter',
packageVersion: `${version}.1`,
publisher: 'CN=E0D72A6F-3D67-49D6-9EA4-99FAFB4620E5',
devCert: process.env.CERT_PATH || 'tools/certs/dev-cert.pfx',
certPass: process.env.CERT_PASSWORD,
windowsKit: process.env.WINDOWS_KIT_PATH,
icon: path.resolve(iconDir, 'icon.ico'),
},
Expand Down

0 comments on commit 74ab437

Please sign in to comment.