Skip to content

Conversation

john-michaelburke
Copy link
Collaborator

@john-michaelburke john-michaelburke commented Dec 6, 2021

  • Adds commands to Makefile for creating mac icns file and Mac installer using create-dmg.
  • Adds mac installer build to CI.
  • Stores installers on release page instead of release build tars.

A test release with the installers:
https://github.com/swift-nav/swift-toolbox/releases/tag/0.12.0-test

@john-michaelburke john-michaelburke force-pushed the john-michaelburke/mac-dmg branch 8 times, most recently from ced7fb3 to 8890f51 Compare December 7, 2021 02:06
@john-michaelburke john-michaelburke force-pushed the john-michaelburke/mac-dmg branch from 8890f51 to 6971d58 Compare December 7, 2021 02:43
@john-michaelburke john-michaelburke changed the title John michaelburke/mac dmg Mac Installer + Reorganized GithubAction Release archives[CPP-326][CPP-419] Dec 7, 2021
INSTALLER_ARCHIVE=$(find installers/Windows -maxdepth 1 -iname "*.exe")
elif [ "$RUNNER_OS" == "macOS" ]; then
mv installers/macOS/*.dmg .
INSTALLER_ARCHIVE=$(find . -maxdepth 1 -iname "*.dmg")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This mv command seems to be necessary for mac? Otherwise the final archive contains the "installers/macOS" folder structure unlike Linux/Windows 🤷

@john-michaelburke john-michaelburke marked this pull request as ready for review December 7, 2021 05:04
@john-michaelburke john-michaelburke requested a review from a team December 7, 2021 05:05
Comment on lines +592 to +593
exec --fail-on-error cp -r py39-dist "${contents_mac_os}"
exec --fail-on-error mv ./${contents_mac_os}/${app_original_name} "./${contents_mac_os}/${app_file_prefix}"
Copy link
Collaborator Author

@john-michaelburke john-michaelburke Dec 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to resort to exec commands here because for the life of me I could not figure out how to rename folders. The default duckscript commands seemed to place which ever folder into the folder provided as the target.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine since this is mac specific

echo "INSTALLER_ARCHIVE=$INSTALLER_ARCHIVE" >>$GITHUB_ENV
if: matrix.os != 'macos-10.15' && github.event_name == 'push' && contains(github.ref, 'refs/tags')
echo $INSTALLER_ARCHIVE >installer-archive.filename
echo "INSTALLER_ARCHIVE=$(cat installer-archive.filename)" >>$GITHUB_ENV
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's this line necessary? Seems redundant (line 298 should emit exactly the same text).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed. Good catch!

Makefile.toml Outdated
'''

[tasks.dist-to-installer.mac]
env = { TMP_DIR = "target/installer", CONTENTS_MACOS_DIR = "MacOS", CONTENTS_RESOURCES_DIR = "Resources", APP_FILE_PREFIX = "Swift-Navigation-Console", APP_ORIGINAL_NAME = "console", VERSION_PATH = "console_backend/src/version.txt", INFO_PLIST_PATH = "installers/macOS/Info.plist", ICNS_PATH = "installers/macOS/icon.icns", BACKGROUND_PATH = "resources/images/LogoBackground.jpg", FINAL_DIR = "installers/macOS" }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will the toml formatter let us put this on multiline lines somehow? This seems pretty difficult to read at the moment.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately it looks like the toml formatter does not clean this up at all and the cargo make as far as I can tell does not offer a newline delimited option for task specific environment variables. Instead I created a separate task that defines the variables which looks better. However I tried reducing the command for creating the dmg but newlines wouldn't work nor storing the arguments in an array or string unfortunately.

Comment on lines +592 to +593
exec --fail-on-error cp -r py39-dist "${contents_mac_os}"
exec --fail-on-error mv ./${contents_mac_os}/${app_original_name} "./${contents_mac_os}/${app_file_prefix}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine since this is mac specific

@john-michaelburke john-michaelburke force-pushed the john-michaelburke/mac-dmg branch from ce07adf to a5d10f0 Compare December 8, 2021 23:33
@joelynch
Copy link
Contributor

joelynch commented Dec 9, 2021

I just ran the MacOS installer and it worked perfectly 🎉

@john-michaelburke
Copy link
Collaborator Author

I just ran the MacOS installer and it worked perfectly 🎉

M1 certified and Monterey certified I guess then? Not too shabby!

@john-michaelburke john-michaelburke merged commit 5964e19 into main Dec 9, 2021
@john-michaelburke john-michaelburke deleted the john-michaelburke/mac-dmg branch December 9, 2021 01:40
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.

3 participants