# OpenMaui Linux CI Pipeline
name: CI

on:
  push:
    branches: [main, final, develop]
  pull_request:
    branches: [main]

env:
  DOTNET_NOLOGO: true
  DOTNET_CLI_TELEMETRY_OPTOUT: true

jobs:
  build-linux:
    name: Build (Linux)
    runs-on: linux-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Restore dependencies
        run: dotnet restore

      - name: Build
        run: dotnet build --configuration Release --no-restore

      - name: Run tests
        run: dotnet test --configuration Release --no-build --verbosity normal
        continue-on-error: true

      - name: Pack NuGet
        run: dotnet pack --configuration Release --no-build -o ./nupkg

      - name: Upload NuGet packages
        uses: actions/upload-artifact@v3
        with:
          name: nuget-packages
          path: ./nupkg/*.nupkg
