Skip to content

Update Build.yml

Update Build.yml #4

Workflow file for this run

name: Build
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest # Use the latest Ubuntu runner
strategy:
matrix:
platform: [android, ios, macos, windows] # Matrix build for different platforms
steps:
- name: Check out the code
uses: actions/checkout@v3
- name: Set up .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x' # .NET version
- name: Install MAUI workloads
run: |
dotnet workload install maui
- name: Restore dependencies
run: dotnet restore
- name: Build project
run: |
dotnet build --configuration Release --framework ${{ matrix.platform }} --no-restore
- name: Publish for ${{ matrix.platform }}
run: |
dotnet publish --configuration Release --framework ${{ matrix.platform }} --output ./publish --no-restore
- name: Archive artifacts
if: success() # Archive the build artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.platform }}-output
path: ./publish