Build on GitHub Actions π #77
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build .NET MAUI Windows | |
run-name: Build on GitHub Actions π | |
on: [push] | |
jobs: | |
Windows-Build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.x | |
# Cache .NET workload installation | |
- name: Cache .NET Workload | |
uses: actions/cache@v3 | |
with: | |
path: C:/Users/runneradmin/AppData/Local/dotnet | |
key: ${{ runner.os }}-dotnet-workload-${{ hashFiles('**/*.csproj') }} | |
restore-keys: | | |
${{ runner.os }}-dotnet-workload- | |
- name: Install MAUI workload | |
run: dotnet workload install maui | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: Restore | |
run: dotnet restore | |
- name: Publish | |
run: dotnet publish -f net8.0-windows10.0.19041.0 -c Release -p:RuntimeIdentifierOverride=win10-x64 | |
- name: Upload Build Artifacts | |
uses: actions/upload-artifact@v3.1.0 | |
with: | |
path: .\**\AppPackages\**\*.* | |
- name: List files in the repository | |
run: | | |
ls ${{ github.workspace }} | |
- run: echo "π This job's status is ${{ job.status }}." | |
Android-Build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.x | |
- run: echo "DotNet is installed and ready to run." | |
# Cache .NET workload installation | |
- name: Cache .NET Workload | |
uses: actions/cache@v3 | |
with: | |
path: C:/Users/runneradmin/AppData/Local/dotnet | |
key: ${{ runner.os }}-dotnet-workload-${{ hashFiles('**/*.csproj') }} | |
restore-keys: | | |
${{ runner.os }}-dotnet-workload- | |
- name: Install MAUI workload | |
run: dotnet workload install maui | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: Restore | |
run: dotnet restore | |
- name: Publish | |
run: dotnet publish -f net8.0-android -c Release | |
- name: Upload Build Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: android-build | |
path: | | |
**/bin/Release/net8.0-android/*.apk | |
- name: List files in the repository | |
run: | | |
ls ${{ github.workspace }} | |
- run: echo "π This job's status is ${{ job.status }}." | |