Skip to content

Samples: Change TargetFramework to .NET 9 #314

Samples: Change TargetFramework to .NET 9

Samples: Change TargetFramework to .NET 9 #314

Workflow file for this run

name: NewsReader.CI
on:
push:
paths:
- 'src/*'
- 'src/NewsReader/**'
- '.github/workflows/**'
- '!.github/workflows/System.Waf.CI.yml'
jobs:
GetVersion:
uses: ./.github/workflows/GetBuildVersion.yml
Android:
runs-on: windows-2022
needs: GetVersion
steps:
- name: 🔖 Check-out
uses: actions/checkout@v4
- name: ⚙️ Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9'
- name: ⚙️ Install .NET MAUI
run: dotnet workload install maui android
- name: 🛠️ Build
run: |
cd src/NewsReader/NewsReader.MauiSystem
dotnet publish -f:net9.0-android -c:Release -p:ApplicationVersion=${{ needs.GetVersion.outputs.versionCode }} -p:ApplicationDisplayVersion=${{ needs.GetVersion.outputs.version }}
- name: 📦 Upload AAB, APK
uses: actions/upload-artifact@v4
with:
name: newsreader-android
if-no-files-found: error
path: |
./**/publish/*Signed.aab
./**/publish/*Signed.apk
Windows:
runs-on: windows-2022
needs: GetVersion
steps:
- name: 🔖 Check-out
uses: actions/checkout@v4
- name: ⚙️ Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9'
- name: ⚙️ Install .NET MAUI
run: dotnet workload install maui
- name: 🛠️ Build
# -p:ApplicationVersion=0 because of https://github.com/dotnet/maui/issues/18571
run: |
cd src/NewsReader/NewsReader.MauiSystem
dotnet publish -f:net9.0-windows10.0.19041.0 -c:Release -p:ApplicationDisplayVersion=${{ needs.GetVersion.outputs.version }} -p:ApplicationVersion=0
iOS:
runs-on: macos-14
needs: GetVersion
steps:
- name: 🔖 Check-out
uses: actions/checkout@v4
- name: ⚙️ Set Xcode version
run: |
XCODE_ROOT=/Applications/Xcode_15.4.app
echo "MD_APPLE_SDK_ROOT=$XCODE_ROOT" >> $GITHUB_ENV # set environment variable to specify Xcode for Mono and Xamarin
sudo xcode-select -s $XCODE_ROOT
- name: ⚙️ Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9'
- name: ⚙️ Install .NET MAUI
run: dotnet workload install maui ios
- name: 🛠️ Build
run: |
cd src/NewsReader/NewsReader.MauiSystem
dotnet build -f net9.0-ios -c:Release /p:packageApp=false /p:buildForSimulator=true /p:ArchiveOnBuild=false -p:ApplicationVersion=${{ needs.GetVersion.outputs.version }} -p:ApplicationDisplayVersion=${{ needs.GetVersion.outputs.version }}
Test:
runs-on: windows-2022
needs: GetVersion
steps:
- name: 🔖 Check-out
uses: actions/checkout@v4
- name: 🕵️ Test - Domain.Test
run: |
cd src/NewsReader/NewsReader.Domain.Test
dotnet test -c:Release -p:Version=${{ needs.GetVersion.outputs.version }}
- name: 🕵️ Test - Presentation.Test
run: |
cd src/NewsReader/NewsReader.Presentation.Test
dotnet test -c:Release -p:Version=${{ needs.GetVersion.outputs.version }}