Release pipeline with azure devops and app center for xamarin apps

Creating a release pipeline

Azure devops allows us to build a Xamarin app, create artifacts (ipa/apk files) and publish those artifacts to app center for distribution. By going through app center we can select the group(s) to distribute or even distribute straight to the distribution stores. But that is another topic that we will dive into later. For now, our goal is to create a release pipeline that will simply publish the artifacts from azure devops to app center’s default collaborator group.

To begin with, we will create a release pipeline with following two stages:

  1. Android stage
  2. iOS Stage

Creating Android Stage

  1. Select Empty job – Enter a stage name such as Android-dev and close the window.
  2. Click on add artifact and select the source build pipeline we build in the Continuous integration with azure devops for xamarin apps post. Click add.
  3. Enable continuous deployment trigger – On the top right corner, click on the lightning icon (continuous deployment trigger) and enable the continuous deployment trigger. This will kick off the release cycle whenever a CI build completes successfully.
  4. Add app center distribute task – Click on the Android-Dev stage we created to add tasks. Search and add app center distribute task as shown below.
  5. app center distribution task
  6. Create service connection – This allows azure devOps to communicate with app center via Api. You can acquire the app api token from app center as described in the app center api documentation
  7. App slug – This in an app identifier in the format the username/app-identifier. This can be retrieved from the app center url which has the following format https://appcenter/ms/users/{username}/apps/{app-identifier}
  8. Binary file path – Browse for apk file drop folder i.e. where the build pipeline stored the apk artifact.
  9. Release notes – Enter any relevant description as the release notes
  10. Release destination – Leave the default group which will correspond to the collaborators group in app center. You can also choose a different group by entering the destination id. To select multiple groups, separate the ids using commas or semicolons
  11. Symbols – Update to Android as this is an android deployment. This will provide additional app metadata. In the mapping file, browse the drop folder for the manifest.xml file
  12. Save the pipeline – Save the pipeline in the required folder.
  13. Create release – Create and run the release pipeline. The process will kick off and successfully publish to app center releases and notify users in the collaborator’s group if this option was selected.

android pipeline

Creating iOS stage

  1. Click on edit pipeline and add a new stage.
  2. Select empty job and update the stage name to ios-Dev.
  3. Given we have already set up the artifacts source build pipeline and enable continuous deployment trigger in the previous steps, we can click on the ios-Dev stage to add task.
  4. Add app center distribute task
  5. Create service connection – Follow the same steps as in the Android phase to establish an ios service connection between devOps and app center.
  6. App slug – This should be similar to the Android phase if in the same directory. Otherwise follow the above app slug android steps.
  7. Binary file path – Locate the ipa file path.
  8. Save and create release – Update the symbols to apple then save and create the release pipeline. This should create an iOS release in app center.

ios pipeline

Conclusion

After creating the above android and iOS stage, our pipeline should look something similar to the below diagram. Running the pipeline should also result in two releases, iOS release and android release.

release pipeline

For more info, see the Continous delivery & release management video link

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s