Skip to content

Commit 43f0ccb

Browse files
committed
Use appropriate indicator for dependency installation conditionals in build workflow
The Windows builds of the application are cryptographically signed. The signing requires an "eToken" hardware authentication device be connected to the machine performing the signing. This means that it is necessary to use a self-hosted GitHub Actions runner for the Windows job of the build workflow rather than the runners hosted by GitHub. There are some unique characteristics of the self-hosted runner which the workflow code must accommodate. One of these is that, rather than installing dependencies of the build process during the workflow run as is done for the GitHub-hosted runners, the dependencies are preinstalled in the self-hosted runner machine. So the dependency installation steps must be configured so that they will be skipped when the job is running on the self-hosted runner. This is done by adding a conditional to the steps. Previously the conditional was based on the value of the `runner.os` context item. This is not an appropriate indicator of the job running on the self-hosted runner because `runner.os` will have the same value if the job was running on a GitHub-hosted Windows runner. That might seem like only a hypothetical problem since the workflow does not use a GitHub-hosted Windows runner. However, it is important to support the use of the workflow in forks of the repository. In addition to the possible value to hard forked projects, this is essential to allow conscientious contributors to test contributions to the build and release system in their own fork prior to submitting a pull request. The conditionals are changed to use the more appropriate indicator of the specific name of the self-hosted Windows runner (via the `runner.name` context item).
1 parent c0b0b84 commit 43f0ccb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Diff for: .github/workflows/build.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -321,42 +321,42 @@ jobs:
321321
uses: actions/checkout@v3
322322

323323
- name: Install Node.js
324-
if: fromJSON(matrix.config.container) == null && runner.os != 'Windows'
324+
if: fromJSON(matrix.config.container) == null && runner.name != 'WINDOWS-SIGN-PC'
325325
uses: actions/setup-node@v4
326326
with:
327327
node-version: ${{ env.NODE_VERSION }}
328328
registry-url: 'https://registry.npmjs.org'
329329
cache: 'yarn'
330330

331331
- name: Install Python 3.x
332-
if: fromJSON(matrix.config.container) == null && runner.os != 'Windows'
332+
if: fromJSON(matrix.config.container) == null && runner.name != 'WINDOWS-SIGN-PC'
333333
uses: actions/setup-python@v5
334334
with:
335335
python-version: '3.11.x'
336336

337337
- name: Install Go
338-
if: fromJSON(matrix.config.container) == null && runner.os != 'Windows'
338+
if: fromJSON(matrix.config.container) == null && runner.name != 'WINDOWS-SIGN-PC'
339339
uses: actions/setup-go@v5
340340
with:
341341
go-version: ${{ env.GO_VERSION }}
342342

343343
- name: Install Go
344344
# actions/setup-go@v5 has dependency on a higher version of glibc than available in the Linux container.
345-
if: fromJSON(matrix.config.container) != null && runner.os != 'Windows'
345+
if: fromJSON(matrix.config.container) != null && runner.name != 'WINDOWS-SIGN-PC'
346346
uses: actions/setup-go@v4
347347
with:
348348
go-version: ${{ env.GO_VERSION }}
349349

350350
- name: Install Taskfile
351-
if: fromJSON(matrix.config.container) == null && runner.os != 'Windows'
351+
if: fromJSON(matrix.config.container) == null && runner.name != 'WINDOWS-SIGN-PC'
352352
uses: arduino/setup-task@v2
353353
with:
354354
repo-token: ${{ secrets.GITHUB_TOKEN }}
355355
version: 3.x
356356

357357
- name: Install Taskfile
358358
# actions/setup-task@v2 has dependency on a higher version of glibc than available in the Linux container.
359-
if: fromJSON(matrix.config.container) != null && runner.os != 'Windows'
359+
if: fromJSON(matrix.config.container) != null && runner.name != 'WINDOWS-SIGN-PC'
360360
uses: arduino/setup-task@v1
361361
with:
362362
repo-token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)