This GitHub Actions workflow automates the building, testing, and optional publishing of Xamarin libraries.
To use this reusable workflow in your GitHub Actions, create a workflow file that calls this workflow using the workflow_call
trigger.
lib-version
: Version of the library to buildlib-name
: Name of the Xamarin libraryspec-file
: Path to the specification fileconfiguration
: Build configuration (e.g., "Release" or "Debug")publish
: Boolean flag to determine if the library should be published
aws-github-role-name
: AWS IAM role name (default: "github_oidc_readonly")aws-account-id
: AWS account ID (default: "007065811408")aws-ecr-region
: AWS ECR region (default: "eu-west-3")
name: Build My Xamarin Library
on:
push:
branches: [ main ]
jobs:
build-lib:
uses: ./.github/workflows/build-xamarin-lib.yml
with:
lib-version: '1.0.0'
lib-name: 'MyXamarinLibrary'
spec-file: 'MyXamarinLibrary.nuspec'
configuration: 'Release'
publish: true
-
ECR Authentication
- Configures AWS credentials
- Logs into Amazon ECR
- Provides registry credentials for subsequent steps
-
Build Process
- Runs in a custom Xamarin Android container from ECR
- Checks out the repository
- Builds the library
- Runs tests
- Optionally publishes the library to NuGet
- AWS ECR access with appropriate permissions
- NuGet API key (if publishing is enabled)
- Appropriate repository permissions
- The workflow uses a custom Docker image from ECR for building Xamarin libraries
- Tests results will be automatically reported to GitHub
- Publishing will only occur if the
publish
input is set totrue
- Make sure to configure the necessary secrets in your GitHub repository settings
- Uses OIDC for AWS authentication
- Requires specific GitHub Actions permissions
- Runs in a containerized environment for isolation
For more information about the individual actions used in this workflow, refer to: