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

Update MacOS packaging_games.md #58

Merged
merged 7 commits into from
Sep 29, 2024
Merged

Conversation

dellis1972
Copy link
Contributor

Update the Packaging instructions for MacOS to include PublishAot and other improvements.

@ThomasFOG
Copy link
Contributor

Just a note which may be worth turning into a feature in the future: this is the script that we're using to generate automatically a .app bundle when using dotnet publish https://github.com/FlyingOakGames/GreedyKid/blob/main/GreedyKid_Desktop/GreedyKid_Desktop/post_build.ps1

We can likely do something like that directly built into MonoGame.

@dellis1972
Copy link
Contributor Author

Just a note which may be worth turning into a feature in the future: this is the script that we're using to generate automatically a .app bundle when using dotnet publish https://github.com/FlyingOakGames/GreedyKid/blob/main/GreedyKid_Desktop/GreedyKid_Desktop/post_build.ps1

We can likely do something like that directly built into MonoGame.
I saw that script.

I already built a packaging build system a while back via https://www.nuget.org/packages/InfinitespaceStudios.MonoGame.Packaging/#readme-body-tab But that needs to be updated for .net 8 and NativeAOT. Although I'd probably start it from scratch if I had to do that as I'm not sure anyone really used it 🤣

I was going to submit a "PackageForMac" Target+Task for MonoGame which automated all these steps, but I got the impression that that kind of thing was not wanted in the main repo given that all of the content building msbuild tasks were stripped out in favour of just Exec calls. I'm not a fan having to write and maintain .sh or ps1 scripts when users on all platforms will have msbuild available.

@ThomasFOG
Copy link
Contributor

msbuild sure is the better way to do this and I would vouch for an automatic dotnet publish -r osx that creates the package by default (although it'd be incomplete because of the x64 and arm64 separation that needs a lipo to fuse them properly).

It just happened to be a script on our end because that was the most convenient to put together internally, but clearly is sub-optimal.

As for the lipo step, we do this on Github Actions (because we don't have a mac build box locally to run NativeAOT): https://github.com/FlyingOakGames/PlaceholderGame/blob/2978a0348917192fa8b39c9d3d0798ade40242e5/.github/workflows/build.yml#L70

Basically: we create two .app for x64 and arm64 with NativeAOT, and lipo them post build on Github Actions.

This placeholdergame repo basically is how we build our Steam builds for all systems painlessly.

@dellis1972 dellis1972 force-pushed the dellis1972-macos-packaging branch from 45f7c64 to a5fb37b Compare September 26, 2024 19:54
ThomasFOG
ThomasFOG previously approved these changes Sep 27, 2024
Minor fixes and corrections
@dellis1972 dellis1972 marked this pull request as ready for review September 27, 2024 20:27
@SimonDarksideJ SimonDarksideJ merged commit 56e6932 into main Sep 29, 2024
2 checks passed
@SimonDarksideJ SimonDarksideJ deleted the dellis1972-macos-packaging branch September 29, 2024 08:49
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