Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

windows code signing

Richie McIlroy291e394a0733
diff --git a/.github/signpath/artifact-configuration.xml b/.github/signpath/artifact-configuration.xml
new file mode 100644
index 000000000..f01c852f8
--- /dev/null
+++ b/.github/signpath/artifact-configuration.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<artifact-configuration xmlns="http://signpath.io/artifact-configuration/v1">
+ <zip-file>
+ <pe-file path="*.exe" max-matches="unbounded">
+ <authenticode-sign />
+ </pe-file>
+ </zip-file>
+</artifact-configuration>
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index a8056edd4..c73854a6a 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -133,6 +133,7 @@ jobs:
permissions:
contents: write
actions: read
+ id-token: write
strategy:
fail-fast: false
matrix:
@@ -208,51 +209,50 @@ jobs:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
- # - name: Upload unsigned Windows installer
- # if: ${{ runner.os == 'Windows' }}
- # id: upload_unsigned_windows_installer
- # uses: actions/upload-artifact@v4
- # with:
- # name: unsigned-windows-installer
- # path: target/${{ matrix.settings.target }}/release/bundle/nsis/*.exe
- # if-no-files-found: error
-
- # - name: Submit SignPath signing request
- # if: ${{ runner.os == 'Windows' }}
- # id: submit_signpath_signing_request
- # uses: signpath/github-action-submit-signing-request@v1
- # with:
- # api-token: ${{ secrets.SIGNPATH_API_TOKEN }}
- # organization-id: ${{ secrets.SIGNPATH_ORGANIZATION_ID }}
- # project-slug: ${{ secrets.SIGNPATH_PROJECT_SLUG }}
- # signing-policy-slug: ${{ secrets.SIGNPATH_SIGNING_POLICY_SLUG }}
- # github-artifact-id: ${{ steps.upload_unsigned_windows_installer.outputs.artifact-id }}
- # wait-for-completion: true
- # output-artifact-directory: signed-windows-installer
-
- # - name: Restore signed Windows installer
- # if: ${{ runner.os == 'Windows' }}
- # shell: pwsh
- # run: |
- # $signedDir = "signed-windows-installer"
- # $bundleDir = "target/${{ matrix.settings.target }}/release/bundle/nsis"
-
- # if (-not (Test-Path $signedDir)) {
- # throw "Signed artifact directory '$signedDir' not found."
- # }
-
- # $executables = Get-ChildItem -Path $signedDir -Filter *.exe -Recurse
- # if (-not $executables) {
- # throw "No signed executables found in '$signedDir'."
- # }
-
- # # Copy signed executables back to the original bundle location for CrabNebula upload
- # Write-Host "Copying signed executables to: $bundleDir"
- # Copy-Item -Path (Join-Path $signedDir '*.exe') -Destination $bundleDir -Force
-
- # # List the files to verify
- # Write-Host "Files in bundle directory after signing:"
- # Get-ChildItem -Path $bundleDir -Filter *.exe | ForEach-Object { Write-Host " - $($_.Name)" }
+ - name: Upload unsigned Windows installer
+ if: ${{ runner.os == 'Windows' }}
+ id: upload_unsigned_windows_installer
+ uses: actions/upload-artifact@v4
+ with:
+ name: unsigned-windows-installer
+ path: target/${{ matrix.settings.target }}/release/bundle/nsis/*.exe
+ if-no-files-found: error
+
+ - name: Submit SignPath signing request
+ if: ${{ runner.os == 'Windows' }}
+ id: submit_signpath_signing_request
+ uses: signpath/github-action-submit-signing-request@v1
+ with:
+ api-token: ${{ secrets.SIGNPATH_API_TOKEN }}
+ organization-id: ${{ secrets.SIGNPATH_ORGANIZATION_ID }}
+ project-slug: ${{ secrets.SIGNPATH_PROJECT_SLUG }}
+ signing-policy-slug: ${{ secrets.SIGNPATH_SIGNING_POLICY_SLUG }}
+ artifact-configuration-slug: ${{ secrets.SIGNPATH_ARTIFACT_CONFIGURATION_SLUG }}
+ github-artifact-id: ${{ steps.upload_unsigned_windows_installer.outputs.artifact-id }}
+ wait-for-completion: true
+ output-artifact-directory: signed-windows-installer
+
+ - name: Restore signed Windows installer
+ if: ${{ runner.os == 'Windows' }}
+ shell: pwsh
+ run: |
+ $signedDir = "signed-windows-installer"
+ $bundleDir = "target/${{ matrix.settings.target }}/release/bundle/nsis"
+
+ if (-not (Test-Path $signedDir)) {
+ throw "Signed artifact directory '$signedDir' not found."
+ }
+
+ $executables = Get-ChildItem -Path $signedDir -Filter *.exe -Recurse
+ if (-not $executables) {
+ throw "No signed executables found in '$signedDir'."
+ }
+
+ Write-Host "Copying signed executables to: $bundleDir"
+ Copy-Item -Path (Join-Path $signedDir '*.exe') -Destination $bundleDir -Force
+
+ Write-Host "Files in bundle directory after signing:"
+ Get-ChildItem -Path $bundleDir -Filter *.exe | ForEach-Object { Write-Host " - $($_.Name)" }
- name: Upload assets
uses: crabnebula-dev/cloud-release@v0