ryanmcgrath / cacao

Rust bindings for AppKit (macOS) and UIKit (iOS/tvOS). Experimental, but working!
MIT License
1.8k stars 65 forks source link

How to publish an app #62

Open dominikwilkowski opened 1 year ago

dominikwilkowski commented 1 year ago

Touched on in #19 I think it would be super useful to describe a way to compile your rust code with xcode to get code-signing to work and publish it in either app store (macOS and iOS). Using cargo-bundle gives us the bundle but I have not found a way to use it to code sign the binary for distribution. I have seen xcode templates for running rust but they seem all outdated and not working well. I feel like that might be the last bit for an end-to-end dev cycle for cacao.

ryanmcgrath commented 1 year ago

Mmmm, you don't need to use xcode for code-signing and submission. You can refer to a basic example here:

https://github.com/secretkeysio/subatomic/blob/trunk/release

You may also need to notarize your app. This can be done outside of Xcode as well (and I think there's actually a new/better way to do it as of Big Sur), but the way I've historically done it can be seen in project-slippi's CI scripts:

https://github.com/project-slippi/Ishiiruka/blob/slippi/Tools/notarize_netplay.sh

You can then submit to the app store by using e.g Transporter

It's just a matter of setting up your signing certs/etc correctly, but that's the name of the game with Apple. :)

ryanmcgrath commented 1 year ago

Also keep in mind that certain things are different in app-store apps (sandboxing, etc). I would be sure to enable the necessary entitlements and test in release mode with a signed + notarized build before submission.

ryanmcgrath commented 1 year ago

(Wrong button, leaving this open - will close it if someone wants to PR a guide on doing this, as I've simply no time to do so myself right now)

madsmtm commented 1 year ago

There's also the apple-codesign project, a pure Rust tool for doing both code-signing and notarization.

ryanmcgrath commented 1 year ago

Ah, right! I always forget about that one for some reason.

dominikwilkowski commented 1 year ago

These are all very good resources that would be super valuable for a consumer to have. I'll see how I go in using them and then maybe have some time to write it all up where ever the appropriate place for that would be