Skip to content

Commit

Permalink
ci: Properly find Windows codesign certificate
Browse files Browse the repository at this point in the history
  • Loading branch information
felixrieseberg committed Dec 24, 2018
1 parent aefe273 commit 346742b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 0 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ install:
$filename = Convert-Path .\cert.p12
$bytes = [Convert]::FromBase64String($env:WINDOWS_CERTIFICATE_P12)
[IO.File]::WriteAllBytes($filename, $bytes)
$env:WINDOWS_CERTIFICATE_FILE = $filename
}
- ps: Install-Product node $env:nodejs_version x64
- node --version
Expand Down
13 changes: 11 additions & 2 deletions forge.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* tslint:disable */

const path = require('path')
const fs = require('fs')
const packageJson = require('./package.json')

const { version } = packageJson
Expand Down Expand Up @@ -39,6 +40,14 @@ module.exports = {
name: '@electron-forge/maker-squirrel',
platforms: ['win32'],
config: (arch) => {
const certificateFile = process.env.CI
? path.join(__dirname, 'cert.p12')
: process.env.WINDOWS_CERTIFICATE_FILE;

if (!certificateFile || !fs.existsSync(certificateFile)) {
console.warn(`Warning: Could not find certificate file at ${certificateFile}`)
}

return {
name: 'electron-fiddle',
authors: 'Electron Community',
Expand All @@ -49,8 +58,8 @@ module.exports = {
remoteReleases: '',
setupExe: `electron-fiddle-${version}-${arch}-setup.exe`,
setupIcon: path.resolve(iconDir, 'fiddle.ico'),
certificateFile: process.env.WINDOWS_CERTIFICATE_FILE,
certificatePassword: process.env.WINDOWS_CERTIFICATE_PASSWORD
certificatePassword: process.env.WINDOWS_CERTIFICATE_PASSWORD,
certificateFile
}
}
},
Expand Down

0 comments on commit 346742b

Please sign in to comment.