-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Autobuild: Combine and simplify Mac build scripts #2514
Autobuild: Combine and simplify Mac build scripts #2514
Conversation
Related: jamulussoftware#2503 - Move all autobuild/mac/* scripts to a single .github/autobuild/mac.sh script which is called for the different stages (setup/build/get-artifacts). - Condense redundant parameter parsing into a single step - Create functions with proper names for larger steps - Inline Github artifact output definition as it's shorter that way - Make shellcheck-clean
cmd1_prebuild: "QT_VERSION=5.9.9 SIGN_IF_POSSIBLE=0 ARTIFACT_SUFFIX=_legacy ./.github/autobuild/mac.sh setup" | ||
cmd2_build: "QT_VERSION=5.9.9 SIGN_IF_POSSIBLE=0 ARTIFACT_SUFFIX=_legacy ./.github/autobuild/mac.sh build" | ||
cmd3_postbuild: "QT_VERSION=5.9.9 SIGN_IF_POSSIBLE=0 ARTIFACT_SUFFIX=_legacy ./.github/autobuild/mac.sh get-artifacts" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I chose to go with inline environment variables here.
For context:
- Windows uses PowerShell's argument parsing
- Linux doesn't require any parameters (yet)
So, the possibilities for Mac would be:
- Implement a argument parsing loop via
getopts
to (closely) match PowerShell (longer) - Set environment variables via workflow (downside: needs duplication in multiple places and needs consistent updates regarding cache key)
- Use positional arguments like we used to (downside: with the combination of all steps, we would already be using 3+1 arguments; it's getting harder to keep track of the proper order)
Among those, the most-readable and yet simplest implementation is the usage of inline environment variables.
I also thought about converting Windows/PowerShell to environment variables, but it seems that setting this inline is not as nice as on *nix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a comparison with the old scripts, which looked ok. CI green too, so approving.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The environment var path is certainly new... Going to approve and merge this. @emlynmac should test this on his repo too.
Short description of changes
Move all autobuild/mac/* scripts to a single .github/autobuild/mac.sh script which is called for the different stages (setup/build/get-artifacts).
Condense redundant parameter parsing into a single step
Create functions with proper names for larger steps
Inline Github artifact output definition as it's shorter that way
Make shellcheck-clean
CHANGELOG: Autobuild: Refactored and simplified Mac build scripts.
(will be condensed...)
Context: Fixes an issue?
Related: #2503
Does this change need documentation? What needs to be documented and how?
Status of this Pull Request
Ready for review.
What is missing until this pull request can be merged?
Checklist