Skip to main content

CI/CD

The aim of this article is to setup bi-directional communication (<->) with GitHub and App Center. It is possible to setup this connection up in one step but only if you create a new GitHub repository. Then (under "Grant your Marketplace apps access to this repository") you can choose App Center as integration service.

Otherwise you have to go through the following two steps:

  1. App Center with GitHub
  2. GitHub with App Center

Setup (GitHub -> App Center)

A very powerful mobile CI/CD platform is Microsoft App Center. By integrating your repository (GitHub, GitLab, etc.) you can trigger your app builds when you create a merge request for example. You can also trigger tests.

Follow the App Center Setup for a basic integration of GitHub to App Center. This will create a Webhook for each application over in GitHub (which we will later on delete because of the App Center integration - step 2).

This basic integration will trigger builds once the pull request got merged into the target branch. For now, App Center knows when to trigger these builds but there is no connection back from App Center to GitHub. Meaning for App Center to provide feedback to GitHub we have to perform an additional step.

Github Checks (App Center -> GibHub)

The Checks API enables you to build GitHub Apps that run powerful checks against code changes in a repository. ou can create apps that perform continuous integration, code linting, or code scanning services and provide detailed feedback on commits (see here).

Unfortunately, there is no seamless integration with GitHub Checks (see this issue). As a workaround you have to create an additional App Center projects for each app. For this go over to GitHub > Marketplace and install the App Center extension. This will create two new apps over in App Center which you must setup accordingly and from which you must now copy the secrets over to your repository to replace the old ones.

Once you have done that you will be able to trigger these checks/builds on merge/pull requests and not when the actual merge gets performed.

Cleanup

If you did not choose the App Center integration from the start you now have obsolete Webhooks in GitHub and obsolete projects, both from step 1, over in App Center. You can just go over to GitHub and delete the Webhooks and go over to App Center and delete those apps as well. If you want you can move your new apps to the previous organization if you've created one.