Use appropriate indicator for dependency installation conditionals in build workflow #2565
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
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 (#2452).
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 becauserunner.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.Change description
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.Reviewer checklist