# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: Nightly

on:
  workflow_dispatch:
  schedule:
    # This runs every day at midnight: https://crontab.guru/#0_0_*_*_*
    - cron: "0 0 * * *"

jobs:
  build:
    strategy:
      matrix:
        os: [windows-latest, ubuntu-latest]
        include:
          - os: windows-latest
            build: Campofinale-${{github.ref_name}}-Windows
          - os: ubuntu-latest
            build: Campofinale-${{github.ref_name}}-Linux
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v4
      - name: Setup .NET
        uses: actions/setup-dotnet@v4
        with:
          dotnet-version: 8.0.x
      - name: Restore dependencies
        run: dotnet restore
      - name: Build
        run: dotnet build --no-restore --configuration Release
      - name: Upload Artifacts
        uses: actions/upload-artifact@v4
        with:
          name: ${{ matrix.build }}
          path: Campofinale/bin/Release/net8.0
