name: Corral Release

on:
  release:
    types: [published]

env:
  SOLUTION: source/Corral.sln

jobs:
  job0:
    name: Corral Release
    runs-on: ubuntu-20.04
    steps:
      - name: Setup dotnet
        uses: actions/setup-dotnet@v1
        with:
          dotnet-version: '5.0.x'
      - name: Checkout Corral
        uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - name: Build Corral, package Corral
        run: |
          # Find version from tag info
          VERSION="${GITHUB_REF##*/v}"
          echo VERSION=$VERSION
          # Change directory to Corral root folder
          cd $GITHUB_WORKSPACE
          # Restore dotnet tools
          dotnet tool restore
          # Build Corral
          dotnet build -p:Version=$VERSION -c Release ${SOLUTION}
          # Create packages
          dotnet pack -p:Version=$VERSION --no-build -c Release ${SOLUTION}
      - name: Deploy to nuget
        run:
          dotnet nuget push "source/Corral/bin/Release/Corral.$VERSION.nupkg" -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json

name: Corral Release

on:
  release:
    types: [published]

env:
  SOLUTION: source/Corral.sln

jobs:
  job0:
    name: Corral Release
    runs-on: ubuntu-20.04
    steps:
      - name: Setup dotnet
        uses: actions/setup-dotnet@v1
        with:
          dotnet-version: '5.0.x'
      - name: Checkout Corral
        uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - name: Build Corral, package Corral
        run: |
          # Find version from tag info
          VERSION="${GITHUB_REF##*/v}"
          echo VERSION=$VERSION
          # Change directory to Corral root folder
          cd $GITHUB_WORKSPACE
          # Restore dotnet tools
          dotnet tool restore
          # Build Corral
          dotnet build -p:Version=$VERSION -c Release ${SOLUTION}
          # Create packages
          dotnet pack -p:Version=$VERSION --no-build -c Release ${SOLUTION}
      - name: Deploy to nuget
        run:
          dotnet nuget push "source/Corral/bin/Release/Corral*.nupkg" -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json

Revert "Minor fix of how the package is selected"
Revert "Minor fix of how the package is selected"

This reverts commit f9ea33fe0909c2b0717ca80ae4863241dc5d408d.
