Skip to content

Commit

Permalink
Merge pull request #778 from particle-iot/feature/sc-131477/sign-cli-…
Browse files Browse the repository at this point in the history
…windows-executable-and-installer

Feature/sc 131477/sign cli windows executable and installer
  • Loading branch information
hugomontero authored Nov 29, 2024
2 parents 336761d + 381bdd7 commit b635742
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 144 deletions.
72 changes: 51 additions & 21 deletions .github/workflows/reusable-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ env:
E2E_PRODUCT_01_ID: ${{ secrets.E2E_PRODUCT_01_ID }}
E2E_PRODUCT_01_NAME: ${{ secrets.E2E_PRODUCT_01_NAME }}
E2E_USERNAME: ${{ secrets.E2E_USERNAME }}
PARTICLE_WINDOWS_SIGNING_CERT: ${{ secrets.PARTICLE_WINDOWS_SIGNING_CERT }}
PARTICLE_WINDOWS_SIGNING_PASS: ${{ secrets.PARTICLE_WINDOWS_SIGNING_PASS }}
jobs:
build:
runs-on: ubuntu-latest # Choose an appropriate runner
Expand Down Expand Up @@ -70,24 +68,6 @@ jobs:
- name: Build Package
run: npm run build

- 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 -- particle-cli-win-x64 $(pwd)/osslsigncode/bin/osslsigncode
- name: Generate Windows installer
run: |
npm run generate:win-installer $(pwd)/osslsigncode/bin/osslsigncode
- name: Save Cache
uses: actions/cache@v3
with:
Expand All @@ -97,6 +77,56 @@ jobs:
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: package
name: not_signed
path: build/
windows-sign:
runs-on: windows-latest
needs: build
steps:
- uses: actions/checkout@v3
- name: Install NSIS
run: choco install nsis -y
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: not_signed
path: build/
- name: Sign Windows Executable
uses: azure/[email protected]
with:
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }}
endpoint: ${{ secrets.AZURE_ENDPOINT }}
trusted-signing-account-name: ${{ secrets.AZURE_CODE_SIGNING_NAME }}
certificate-profile-name: ${{ secrets.AZURE_CERT_PROFILE_NAME }}

# Sign all exes inside the folder
files-folder: build
files-folder-filter: exe

- name: Generate Windows Installer
run: makensis.exe installer\windows\ParticleCLISetup.nsi

- name: Move Installer to Build Folder
run: move installer\windows\ParticleCLISetup.exe build\ParticleCLISetup.exe

- name: Sign Windows Installer
uses: azure/[email protected]
with:
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }}
endpoint: ${{ secrets.AZURE_ENDPOINT }}
trusted-signing-account-name: ${{ secrets.AZURE_CODE_SIGNING_NAME }}
certificate-profile-name: ${{ secrets.AZURE_CERT_PROFILE_NAME }}

# Sign all exes inside the folder
files-folder: build
files-folder-filter: exe

- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: package
path: build/
15 changes: 0 additions & 15 deletions scripts/generate-win-installer.js

This file was deleted.

108 changes: 0 additions & 108 deletions scripts/win-sign.js

This file was deleted.

0 comments on commit b635742

Please sign in to comment.