Skip to content

Commit 39ca7c7

Browse files
committed
ci: split signing out of the Windows build job
- Move signing, checksum reporting and signature verification into their own sign job. Release signing waits on a human to approve the request in the SignPath UI, so a missed approval now costs a re-run of that job alone rather than another fifteen minutes of PyInstaller. - Raise the wait to an hour on tags. The request only appears once the build has finished, so the action's ten minute default is a narrow window to be watching for. Test signing is unattended and keeps it. - Hold the unsigned artifact for a week rather than a day, since it is now the input to a job that may be re-run on a later day. - Decide the signing condition once in a job level variable instead of spelling the same expression out at three separate steps.
1 parent c538cf6 commit 39ca7c7

1 file changed

Lines changed: 31 additions & 16 deletions

File tree

.github/workflows/ci.yml

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,8 @@ jobs:
7676
name: Windows build
7777
runs-on: windows-latest
7878
needs: test
79-
permissions:
80-
contents: read
81-
# The signing action reads the job details and downloads the uploaded
82-
# artifact back through the GitHub API.
83-
actions: read
79+
outputs:
80+
unsigned-artifact-id: ${{ steps.unsigned.outputs.artifact-id }}
8481
steps:
8582
- uses: actions/checkout@v4
8683

@@ -123,13 +120,28 @@ jobs:
123120
with:
124121
name: faster-whisper-xxl-gui-unsigned
125122
path: dist/faster-whisper-xxl-gui.exe
126-
retention-days: 1
123+
# Long enough to re-run signing on a later day without a rebuild.
124+
retention-days: 7
127125

126+
# Kept out of the build job: release signing waits on a human in the SignPath
127+
# UI, and a missed approval should not cost another PyInstaller run.
128+
sign:
129+
name: Sign and package
130+
runs-on: windows-latest
131+
needs: build
132+
permissions:
133+
contents: read
134+
# The signing action reads the job details and downloads the uploaded
135+
# artifact back through the GitHub API.
136+
actions: read
137+
env:
128138
# Signed on tags, and on a manual run so the pipeline can be rehearsed
129139
# without cutting a release. Ordinary pushes are left alone: a signing
130140
# request per commit would spend the Foundation's certificate for nothing.
141+
SIGNING: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
142+
steps:
131143
- name: Sign the executable
132-
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
144+
if: env.SIGNING == 'true'
133145
uses: signpath/github-action-submit-signing-request@v2
134146
with:
135147
api-token: ${{ secrets.SIGNPATH_API_TOKEN }}
@@ -140,16 +152,19 @@ jobs:
140152
# an untrusted root, so choosing the policy from the trigger rather
141153
# than by hand keeps a test signature out of a published release.
142154
signing-policy-slug: ${{ startsWith(github.ref, 'refs/tags/') && 'release-signing' || 'test-signing' }}
143-
github-artifact-id: ${{ steps.unsigned.outputs.artifact-id }}
155+
github-artifact-id: ${{ needs.build.outputs.unsigned-artifact-id }}
144156
wait-for-completion: true
157+
# Release signing waits on manual approval, and the request only
158+
# appears once the build is done, so the default 600 is easy to miss.
159+
wait-for-completion-timeout-in-seconds: ${{ startsWith(github.ref, 'refs/tags/') && '3600' || '600' }}
145160
output-artifact-directory: signed
146161

147-
- name: Stage the unsigned build
148-
if: ${{ !(startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch') }}
149-
shell: pwsh
150-
run: |
151-
New-Item -ItemType Directory -Force signed | Out-Null
152-
Copy-Item dist/faster-whisper-xxl-gui.exe signed/
162+
- name: Fetch the unsigned build
163+
if: env.SIGNING != 'true'
164+
uses: actions/download-artifact@v4
165+
with:
166+
name: faster-whisper-xxl-gui-unsigned
167+
path: signed
153168

154169
# After signing, never before. The signature changes the file, so a hash
155170
# taken earlier would not describe what people actually download.
@@ -171,7 +186,7 @@ jobs:
171186
Write-Host "SHA256: $hash"
172187
173188
- name: Verify the signature
174-
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
189+
if: env.SIGNING == 'true'
175190
shell: pwsh
176191
run: |
177192
$sig = Get-AuthenticodeSignature "signed/faster-whisper-xxl-gui.exe"
@@ -202,7 +217,7 @@ jobs:
202217
release:
203218
name: Publish release
204219
runs-on: ubuntu-latest
205-
needs: build
220+
needs: sign
206221
if: startsWith(github.ref, 'refs/tags/')
207222
permissions:
208223
contents: write

0 commit comments

Comments
 (0)