name: '🏗️ Build Plugin'

on:
  push:
    branches:
      - dev
    paths-ignore:
      - '**/*.md'
      - '.gitea/**'
      - '.github/**'
      - 'jellyfin.ruleset'
      - '.gitignore'
      - '.editorconfig'
      - 'LICENSE'
      - 'logo.png'
  pull_request:
    paths-ignore:
      - '**/*.md'
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Repository
        uses: actions/checkout@v6

      - name: Setup .NET
        uses: actions/setup-dotnet@v5
        with:
          dotnet-version: "9.x"

      - name: Build Jellyfin Plugin
        run: |
          dotnet build Jellyfin.Plugin.Seasonals/Jellyfin.Plugin.Seasonals.csproj --configuration Release --output bin/Publish
          cd bin/Publish
          zip -r Jellyfin.Plugin.Seasonals.zip *
          
      - name: Upload Artifact
        uses: christopherHX/gitea-upload-artifact@v4
        with:
          name: plugin-build-artifact
          retention-days: 5
          if-no-files-found: error
          path: bin/Publish/Jellyfin.Plugin.Seasonals.zip