That's enough powershell for today

This commit is contained in:
Markus Olsson 2023-06-29 20:39:55 +02:00
parent ebd5b31384
commit 9ab3fdee11
4 changed files with 7 additions and 28 deletions

View file

@ -114,11 +114,17 @@ jobs:
- name: Run script tests
if: matrix.arch == 'x64'
run: yarn test:script
- name: Install Windows code signing certificate
shell: bash
if: runner.os == 'Windows'
env:
CERT_CONTENTS: ${{ secrets.WINDOWS_CERT_PFX }}
run: |
base64 -d <<<"$CERT_CONTENTS" > ./script/windows-certificate.pfx
- name: Package production app
run: yarn package
env:
npm_config_arch: ${{ matrix.arch }}
WINDOWS_CERT_PFX: ${{ secrets.WINDOWS_CERT_PFX }}
WINDOWS_CERT_PASSWORD: ${{ secrets.WINDOWS_CERT_PASSWORD }}
- name: Upload artifacts
uses: actions/upload-artifact@v3

View file

@ -1,7 +0,0 @@
$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
$file = "$scriptPath\windows-certificate.pfx"
if ((Test-Path $file)) {
Remove-Item $file
}

View file

@ -56,20 +56,6 @@ function packageOSX() {
}
function packageWindows() {
const setupCertificatePath = path.join(
__dirname,
'setup-windows-certificate.ps1'
)
const cleanupCertificatePath = path.join(
__dirname,
'cleanup-windows-certificate.ps1'
)
if (isGitHubActions() && isPublishable()) {
console.log('Installing signing certificate…')
cp.execSync(`powershell ${setupCertificatePath}`, { stdio: 'inherit' })
}
const iconSource = path.join(
__dirname,
'..',

View file

@ -1,6 +0,0 @@
$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
# Everything is terrible: https://stackoverflow.com/a/34969243
$certPath = "$scriptPath\windows-certificate.pfx"
New-Item -Force $certPath -Value ([Text.Encoding]::Utf8.GetString([Convert]::FromBase64String($env:WINDOWS_CERT_PFX)))
Get-Item $certPath | Write-Output
$env:WINDOWS_CERT_PFX.length | Write-Output