Refactor variables in release workflows #200
Merged
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.
GitHub Actions workflows are used to automatically generate beta tester and production builds of the project.
While starting the work to update the workflow code for compatibility with the breaking change introduced in the latest versions of the actions/upload-artifact action (#171), I found that it was quite difficult to follow the workflow code due to the way some variables were defined. The refactoring proposed here is intended to improve the maintainability and readability of the workflows:
Use more meaningful variable names
A separate build is generated for each of the target host types. This is done using a job matrix, which creates a parallel run of the workflow job for each target. The matrix defines variables that provide the data that is specific to each job.
The variable names used previously did not clearly communicate their nature:
These variable names made it very difficult for anyone not intimately familiar with the workings of the workflow to understand its code.
Use workflow environment variables to reduce code duplication
Multiple commands in the notarization step of the "Release" workflow include the path of the folder that contains the build output, and the filename of the package.
Previously, there was some code duplication and inconsistency in how these were referenced.
This is improved on through the consistent use of workflow environment variables.