NR simplify code by using new C# features #216
Workflow file for this run
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: NewsReader.CI | |
on: | |
push: | |
paths: | |
- 'src/*' | |
- 'src/NewsReader/**' | |
- '.github/workflows/**' | |
jobs: | |
GetVersion: | |
uses: ./.github/workflows/GetBuildVersion.yml | |
Android: | |
runs-on: windows-2022 | |
needs: GetVersion | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install .NET MAUI | |
run: | | |
dotnet nuget locals all --clear | |
dotnet workload install maui android | |
- name: Build | |
run: | | |
cd src/NewsReader/NewsReader.MauiSystem | |
dotnet publish -f:net8.0-android -c:Debug -p:ApplicationVersion=${{ needs.GetVersion.outputs.versionCode }} -p:ApplicationDisplayVersion=${{ needs.GetVersion.outputs.version }} # Workaround for https://github.com/dotnet/linker/issues/3126 | |
- name: Upload AAB, APK | |
uses: actions/upload-artifact@v3 | |
with: | |
name: newsreader-android | |
if-no-files-found: error | |
path: | | |
./**/publish/*.aab | |
./**/publish/*.apk | |
Windows: | |
runs-on: windows-2022 | |
needs: GetVersion | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install .NET MAUI | |
run: | | |
dotnet nuget locals all --clear | |
dotnet workload install maui | |
- name: Build | |
run: | | |
cd src/NewsReader/NewsReader.MauiSystem | |
dotnet publish -f:net8.0-windows10.0.19041.0 -c:Release -p:ApplicationDisplayVersion=${{ needs.GetVersion.outputs.version }} | |
iOS: | |
runs-on: macos-13 | |
needs: GetVersion | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set Xcode version | |
run: | | |
XCODE_ROOT=/Applications/Xcode_14.3.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: Install .NET MAUI | |
run: | | |
dotnet nuget locals all --clear | |
dotnet workload install maui ios | |
- name: Build | |
run: | | |
cd src/NewsReader/NewsReader.MauiSystem | |
dotnet build -f net8.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: | |
- uses: actions/checkout@v3 | |
- name: Domain.Test | |
run: | | |
cd src/NewsReader/NewsReader.Domain.Test | |
dotnet test -c:Release -p:Version=${{ needs.GetVersion.outputs.version }} | |
- name: Presentation.Test | |
run: | | |
cd src/NewsReader/NewsReader.Presentation.Test | |
dotnet test -c:Release -p:Version=${{ needs.GetVersion.outputs.version }} |