Skip to content

Commit

Permalink
add osslsigncode binary to sign win exec
Browse files Browse the repository at this point in the history
  • Loading branch information
hugomontero committed May 5, 2024
1 parent 6311aa7 commit 45ba51e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ env:
PARTICLE_WINDOWS_SIGNING_PASS: ${{ secrets.PARTICLE_WINDOWS_SIGNING_PASS }}

jobs:
call-tests:
uses: ./.github/workflows/tests.yml
secrets: inherit
#call-tests:
# uses: ./.github/workflows/tests.yml
# secrets: inherit
build:
needs: call-tests
#needs: call-tests
runs-on: ubuntu-latest # Choose an appropriate runner
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -58,9 +58,16 @@ jobs:
- name: 'Install makensis (apt)'
run: sudo apt update && sudo apt install -y nsis nsis-pluginapi

- name: Download and unzip osslsigncode binary
run: |
mkdir osslsigncode
curl -LJO https://github.com/mtrojnar/osslsigncode/releases/download/2.6/osslsigncode-2.6-ubuntu-20.04.zip
unzip osslsigncode-2.6-ubuntu-20.04.zip -d osslsigncode
chmod +x osslsigncode/bin/osslsigncode
- name: Sign Windows package
run: |
npm run sign:win
npm run sign:win -- particle-cli-win-x64 $(pwd)/osslsigncode/bin/osslsigncode
- name: Generate Windows installer
run: |
Expand Down
4 changes: 2 additions & 2 deletions scripts/generate-win-installer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const fs = require('fs-extra');
const execa = require('execa');

const osslsigncode = process.argv[2] || 'osslsigncode';
(async () => {
// generate ParticleCLISetup installer
const args = [
Expand All @@ -10,6 +10,6 @@ const execa = require('execa');
await fs.move('./installer/windows/ParticleCLISetup.exe', './build/ParticleCLISetup.exe', { overwrite: true });
console.log('Generated ParticleCLISetup installer');
console.log('Signing Windows Installers');
await execa('node', ['./scripts/win-sign.js', 'ParticleCLISetup'], { stdio: 'inherit' });
await execa('node', ['./scripts/win-sign.js', 'ParticleCLISetup', osslsigncode], { stdio: 'inherit' });
console.log('done');
})();
4 changes: 2 additions & 2 deletions scripts/win-sign.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const log = require('../src/lib/log').info;
const logErrorAndExit = require('../src/lib/log').error;
const BUILD_DIR = path.join(__dirname, '..', 'build');
const particleBuildName = process.argv[2] || 'particle-cli-win-x64';

const osslsigncode = process.argv[3] || 'osslsigncode';

(async () => {
try {
Expand Down Expand Up @@ -61,7 +61,7 @@ function winSign(exe, params) {
exe.signed
];

return execa('osslsigncode', args);
return execa(`${osslsigncode}`, args);
}

function getSigningParams(pkgJSON, tmpDir) {
Expand Down

0 comments on commit 45ba51e

Please sign in to comment.