Skip to content

armgit / mimik

Public Imported from GitHub
0

🎬 A browser extension and desktop app that turns your clicks into step-by-step guides with annotated screenshots πŸ“–

ci(desktop): sign the windows installer in a release workflow

Luis Ortiz74faa9f8d8dd
diff --git a/.github/workflows/desktop-windows-release.yml b/.github/workflows/desktop-windows-release.yml
new file mode 100644
index 0000000..6d07ac6
--- /dev/null
+++ b/.github/workflows/desktop-windows-release.yml
@@ -0,0 +1,70 @@
+name: Desktop Windows release
+
+on:
+ workflow_dispatch:
+ workflow_call:
+
+concurrency:
+ group: desktop-windows-release-${{ github.ref }}
+ cancel-in-progress: false
+
+permissions:
+ contents: read
+
+jobs:
+ windows:
+ name: Signed Windows installer
+ runs-on: windows-latest
+ timeout-minutes: 45
+ environment: desktop-production
+ steps:
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ with:
+ persist-credentials: false
+
+ - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
+
+ - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
+ with:
+ node-version: "22"
+
+ - run: pnpm install --frozen-lockfile
+
+ - name: Build the accessibility addon
+ run: pnpm --filter @mimik/capture-native build
+
+ - name: Build the app
+ run: pnpm build:desktop
+
+ - name: Package and sign the installer
+ env:
+ AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
+ AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
+ AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
+ run: pnpm --filter @mimik/desktop exec electron-builder --win --config electron-builder.signed.yml --publish never
+
+ - name: Verify the signatures
+ shell: pwsh
+ run: |
+ $files = Get-ChildItem -Path apps/desktop/dist -Recurse -Filter *.exe
+ if ($files.Count -eq 0) { throw "No executables in apps/desktop/dist" }
+ foreach ($file in $files) {
+ $signature = Get-AuthenticodeSignature -FilePath $file.FullName
+ $subject = $signature.SignerCertificate.Subject
+ Write-Host "$($file.FullName): $($signature.Status) $subject"
+ if ($signature.Status -ne "Valid" -or $subject -notlike "*CN=Westpoint Software Solutions Limited*") {
+ throw "$($file.Name) is not signed by Westpoint Software Solutions Limited"
+ }
+ if (-not $signature.TimeStamperCertificate) { throw "$($file.Name) has no timestamp" }
+ }
+ $updateConfig = Get-Content -Raw -Path apps/desktop/dist/win-unpacked/resources/app-update.yml
+ if ($updateConfig -notmatch "publisherName:\s*\r?\n\s*-\s*Westpoint Software Solutions Limited") { throw "app-update.yml does not pin the publisher" }
+
+ - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
+ with:
+ name: mimik-windows-signed
+ path: |
+ apps/desktop/dist/*.exe
+ apps/desktop/dist/*.exe.blockmap
+ apps/desktop/dist/latest.yml
+ if-no-files-found: error
diff --git a/apps/desktop/electron-builder.signed.yml b/apps/desktop/electron-builder.signed.yml
new file mode 100644
index 0000000..71a0f72
--- /dev/null
+++ b/apps/desktop/electron-builder.signed.yml
@@ -0,0 +1,10 @@
+extends: ./electron-builder.yml
+win:
+ azureSignOptions:
+ endpoint: https://eus.codesigning.azure.net/
+ codeSigningAccountName: westpoint-signing
+ certificateProfileName: mimik
+ TimestampRfc3161: http://timestamp.acs.microsoft.com
+ TimestampDigest: SHA256
+ signtoolOptions:
+ publisherName: Westpoint Software Solutions Limited