Skip to content

Commit 671f571

Browse files
committed
Make code signing optional, add unsigned fallback
SignPath and Tauri signing steps now check for secret availability before running. When signing is not configured, the unsigned NSIS installer is used as the release artifact instead of failing the build. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
1 parent 8dc0622 commit 671f571

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

.github/workflows/build-windows.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ jobs:
9595
if-no-files-found: error
9696

9797
- name: SignPath Sign
98-
if: ${{ inputs.dry == false }}
98+
if: ${{ inputs.dry == false && secrets.SIGNPATH_API_TOKEN != '' }}
99+
id: signpath
99100
uses: signpath/github-action-submit-signing-request@v2
100101
with:
101102
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
@@ -107,15 +108,15 @@ jobs:
107108
output-artifact-directory: 'signed_artifacts'
108109

109110
- name: Restore Tauri signing key
110-
if: ${{ inputs.dry == false }}
111+
if: ${{ inputs.dry == false && secrets.TAURI_PRIVATE_KEY != '' }}
111112
env:
112113
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
113114
run: |
114115
[System.IO.File]::WriteAllBytes("tauri.key", [Convert]::FromBase64String($env:TAURI_PRIVATE_KEY))
115116
shell: pwsh
116117

117118
- name: Sign & Package
118-
if: ${{ inputs.dry == false }}
119+
if: ${{ inputs.dry == false && steps.signpath.outcome == 'success' }}
119120
env:
120121
TAURI_PRIVATE_KEY_PATH: tauri.key
121122
TAURI_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
@@ -126,21 +127,31 @@ jobs:
126127
New-Item -ItemType Directory -Force -Path $releaseDir | Out-Null
127128
128129
# MSI
129-
$msi = Get-ChildItem -Path "signed_artifacts" -Filter *.msi | Select-Object -First 1
130+
$msi = Get-ChildItem -Path "signed_artifacts" -Filter *.msi -ErrorAction SilentlyContinue | Select-Object -First 1
130131
if ($msi) {
131132
$finalMsi = Join-Path $releaseDir "HyperYap_x64.msi"
132133
Copy-Item $msi.FullName -Destination $finalMsi -Force
133134
pnpm tauri signer sign $finalMsi
134135
}
135136
136137
# EXE
137-
$exe = Get-ChildItem -Path "signed_artifacts" -Filter *.exe | Select-Object -First 1
138+
$exe = Get-ChildItem -Path "signed_artifacts" -Filter *.exe -ErrorAction SilentlyContinue | Select-Object -First 1
138139
if ($exe) {
139140
$finalExe = Join-Path $releaseDir "HyperYap_x64-setup.exe"
140141
Copy-Item $exe.FullName -Destination $finalExe -Force
141142
pnpm tauri signer sign $finalExe
142143
}
143144
145+
- name: Prepare release bundle (unsigned fallback)
146+
if: ${{ inputs.dry == false && steps.signpath.outcome != 'success' }}
147+
shell: pwsh
148+
run: |
149+
$releaseDir = "release-bundle"
150+
if (Test-Path $releaseDir) { Remove-Item $releaseDir -Recurse -Force }
151+
New-Item -ItemType Directory -Force -Path $releaseDir | Out-Null
152+
Copy-Item "unsigned_artifacts/*" -Destination $releaseDir -Force
153+
Write-Host "Using unsigned artifacts (SignPath not configured or failed)"
154+
144155
- name: Upload artifact (1 day)
145156
if: ${{ inputs.dry == false }}
146157
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)