name: Pack Nuget

on:
  push:
    branches: [ "action/pack" ]
  pull_request:
    branches: [ "action/pack" ]

jobs:
  nuget:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4.1.1

      - name: Nuget Semi.Avalonia
        run: dotnet pack ./src/Semi.Avalonia -o ./nugets

      - name: Nuget Semi.Avalonia.ColorPicker
        run: dotnet pack ./src/Semi.Avalonia.ColorPicker  -o ./nugets

      - name: Nuget Semi.Avalonia.DataGrid
        run: dotnet pack ./src/Semi.Avalonia.DataGrid  -o ./nugets

      - name: Nuget Semi.Avalonia.TreeDataGrid
        run: dotnet pack ./src/Semi.Avalonia.TreeDataGrid  -o ./nugets

      - name: Upload a Build Artifact
        uses: actions/upload-artifact@v4.3.1
        with:
          name: nugets
          path: ./nugets
