name: Publish to NuGet
on:
  push:
    branches:
      - master # Default release branch
jobs:
  publish:
    name: build, pack & publish
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      # - name: Setup dotnet
      #   uses: actions/setup-dotnet@v1
      #   with:
      #     dotnet-version: 3.1.200

      - name: Publish NuGet
        # You may pin to the exact commit or the version.
        # uses: brandedoutcast/publish-nuget@c12b8546b67672ee38ac87bea491ac94a587f7cc
        uses: alirezanet/publish-nuget@v3.0.4
        with:
          # Filepath of the project to be packaged, relative to root of repository
          PROJECT_FILE_PATH: QControlKit/QControlKit.csproj
          # NuGet package id, used for version detection & defaults to project name
          #PACKAGE_NAME: # optional
          # Filepath with version info, relative to root of repository & defaults to PROJECT_FILE_PATH
          #VERSION_FILE_PATH: # optional
          # Regex pattern to extract version info in a capturing group
          VERSION_REGEX: ^\s*<PackageVersion>(.*)<\/PackageVersion>\s*$
          # Useful with external providers like Nerdbank.GitVersioning, ignores VERSION_FILE_PATH & VERSION_REGEX
          #VERSION_STATIC: # optional
          # Flag to toggle git tagging, enabled by default
          #TAG_COMMIT: # optional, default is true
          # Format of the git tag, [*] gets replaced with actual version
          #TAG_FORMAT: # optional, default is v*
          # API key to authenticate with NuGet server
          NUGET_KEY: ${{secrets.NUGET_KEY}}
          # NuGet server uri hosting the packages, defaults to https://api.nuget.org
          #NUGET_SOURCE: # optional, default is https://api.nuget.org
          # Flag to toggle pushing symbols along with nuget package to the server, disabled by default
          INCLUDE_SYMBOLS: false
