Skip to content

.NET MAUI CI for Windows #27

.NET MAUI CI for Windows

.NET MAUI CI for Windows #27

Workflow file for this run

name: .NET MAUI CI for Windows
on:
push:
branches: [ master ]
paths-ignore:
- '**/*.md'
- '**/*.gitignore'
- '**/*.gitattributes'
pull_request:
branches: [ master ]
workflow_dispatch:
permissions:
contents: read
env:
DOTNET_NOLOGO: true # Disable the .NET logo
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # Disable the .NET first time experience
DOTNET_CLI_TELEMETRY_OPTOUT: true # Disable sending .NET CLI telemetry
jobs:
# MAUI Windows Build
build-windows:
runs-on: windows-latest
name: Windows Build
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x.x
- name: Cache .NET packages
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-dotnet-${{ hashFiles('**/*.csproj', '**/*.sln') }}
restore-keys: |
${{ runner.os }}-dotnet-
- name: Cache MAUI Workload
uses: actions/cache@v3
with:
path: ~/.dotnet/sdk-manifests/8.0.100/maui
key: ${{ runner.os }}-maui-${{ hashFiles('**/*.csproj', '**/*.sln') }}
restore-keys: |
${{ runner.os }}-maui-
- name: Install MAUI Workload
run: dotnet workload install maui --ignore-failed-sources
- name: Restore Dependencies
run: dotnet restore HuaweiHMSInstaller.sln /p:TargetFramework=net8.0-windows10.0.19041.0 /p:configuration=release /p:PublishReadyToRun=true
- name: Build
run: dotnet build src/HuaweiHMSInstaller.csproj /p:TargetFramework=net8.0-windows10.0.19041.0 /p:configuration=release /p:PublishReadyToRun=true --no-restore
- name: Publish for Windows
run: dotnet publish src/HuaweiHMSInstaller.csproj /p:TargetFramework=net8.0-windows10.0.19041.0 /p:configuration=release /p:PublishReadyToRun=true --no-self-contained -c Release -o ./publish/windows
- name: Upload Windows Artifact
uses: actions/upload-artifact@v4
with:
name: windows-app
path: ./publish/windows/**