GitHub Actions Build Xamarin Android CI Pipeline

Here is an example of how to build Xamarin Android project in GitHub Actions. It will trigger on push and pull request. First checkout, restore nuget packages and then build the Xamarin Android project.

Replace Carousel with your project name of course. Enjoy!

name: CI

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]
  workflow_dispatch:

jobs:
  Android:
    runs-on: macos-latest
    steps:
    - uses: actions/checkout@v2
    - name: Android
      run: |
        nuget restore
        cd Carousel/Carousel.Android
        msbuild Carousel.Android.csproj /verbosity:normal /t:Rebuild /p:Configuration=Debug