NET Multi-platform App UI (.NET MAUI) is a cross-platform framework for creating native mobile and desktop apps with C# and XAML. Using .NET MAUI, you can develop apps that can run on Android, iOS, macOS, and Windows from a single shared code-base. In these post series, I will show you how to implement Continuous Integration in your .NET MAUI app using the Microsoft Azure DevOps with YML in a multi-environment.
The steps below represent an approach I follow for my projects due to they accommodate for my requirements. You are free to update the logic and YML files to fit your needs on each project. Also, in an effort to demo the multi-environment, I am using Firebase Analytics services.
- In the Azure Pipelines -> Library upload the Android KeyStore file, the Apple .p12 certificate & provisioning profile files and the Google firebase config files if you are using this service.
Make sure the Google firebase files are renamed using the following sample:
- Then create a variable group called: "App Configuration" within the Library, this variable group will contain the configuration keys for the Android and iOS build and we use them because it is the securest way to store the sensitive data.
- Create a new file azure-pipelines-ios.yml in your code repository at any path you prefer.
- Create a new file azure-pipelines-android.yml in your code repository at any path you prefer.
Basically, the pipelines will always trigger automatically pointing to the staging environment when a versioning tag is added to a branch, however, you can run the pipeline manually and set the environment pointing to production, so it generates a new version of the app. Just, don't forget to set the version tag before trigger the pipeline manually.
What About Distribution?
I'm working in a post to share how to distribute the application through different channels. I hope to have it ready soon.
There are tons of combinations and customizations for the YML and each project may have its own set of rules for CI. Take this just as an example or base and improve it, please!
I hope this helps others to create their own pipelines for .NET MAUI.
Top comments (1)
Thank you so much for the download of the keystore file. We missed that step and COULD NOT get it to work.