Skip to content
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

Merged
merged 1 commit into from
Mar 16, 2022

Conversation

hoffie
Copy link
Member

@hoffie hoffie commented Mar 16, 2022

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?

  • Reviews
  • CI run with signing enabled (will ping emlynmac after reviews are done)

Checklist

  • I've verified that this Pull Request follows the general code principles
  • I tested my code and it does what I want: partially
  • My code follows the style guide
  • I waited some time after this Pull Request was opened and all GitHub checks completed without errors.
  • I've filled all the content above

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
@hoffie hoffie added this to the Release 3.9.0 milestone Mar 16, 2022
Comment on lines +118 to +120
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"
Copy link
Member Author

@hoffie hoffie Mar 16, 2022

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:

  1. Implement a argument parsing loop via getopts to (closely) match PowerShell (longer)
  2. Set environment variables via workflow (downside: needs duplication in multiple places and needs consistent updates regarding cache key)
  3. 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.

Copy link
Member

@softins softins left a 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.

Copy link
Member

@ann0see ann0see left a 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.

@ann0see ann0see merged commit 137cdd3 into jamulussoftware:master Mar 16, 2022
@hoffie hoffie deleted the autobuild-merge-mac-scripts branch March 19, 2022 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants