Skip to content

Merge pull request #18 from sylac/feature/add-navigation-sync-context #38

Merge pull request #18 from sylac/feature/add-navigation-sync-context

Merge pull request #18 from sylac/feature/add-navigation-sync-context #38

Workflow file for this run

name: Build and Test
on:
push:
branches: [ "main", "develop"]
tags:
- 'v*'
pull_request:
branches: [ "main", "develop"]
jobs:
setup:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "9.0.x"
- name: 'Install Latest .NET MAUI Workload'
run: dotnet workload install maui
- name: Install dependencies
run: dotnet restore
build:
name: Build and Test
runs-on: windows-latest
needs: setup
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build
run: dotnet build -c Release
- name: Test
run: dotnet test -c Release --no-build --verbosity normal --logger "trx;LogFileName=TestResults.trx"
- name: Publish Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: TestResults
path: TestResults.trx
release:
name: Release packages
runs-on: windows-latest
needs: [setup, build]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build
run: dotnet build -c Release
- name: Package
run: dotnet pack -c Release --no-build --output nupkgs
- name: Publish Mvvm.Core
if: endsWith(github.ref, 'mvvm-core')
shell: pwsh
run: |
$file = Get-ChildItem -Path nupkgs -Filter "Sylac.Mvvm.Maui*.nupkg" | Select-Object -First 1
if ($file) { dotnet nuget push $file.FullName -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }} || true }
else { Write-Output "No package file found for Mvvm.Core" }
- name: Publish Mvvm.Generators
if: endsWith(github.ref, 'mvvm-generators')
shell: pwsh
run: |
$file = Get-ChildItem -Path nupkgs -Filter "Sylac.Mvvm.Generators*.nupkg" | Select-Object -First 1
if ($file) { dotnet nuget push $file.FullName -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }} || true }
else { Write-Output "No package file found for Mvvm.Generators" }
- name: Publish Mvvm.Maui
if: endsWith(github.ref, 'mvvm-maui')
shell: pwsh
run: |
$file = Get-ChildItem -Path nupkgs -Filter "Sylac.Mvvm.Maui*.nupkg" | Select-Object -First 1
if ($file) { dotnet nuget push $file.FullName -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }} || true }
else { Write-Output "No package file found for Mvvm.Maui" }