name: ASP.NET Core CI

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1

    - name: Write Git Version to file
      uses: docker://gittools/gitversion:5.0.2-beta1-27-linux-centos-7-netcoreapp2.2
      with:
        args: /github/workspace /nofetch /exec /bin/sh /execargs "-c \"echo $GitVersion_FullSemVer > /github/workspace/version.txt\""

    - name: Echo Git version
      run: cat version.txt

    - name: Patch AssemblyInfos
      run: pwsh update-assemblyversion.ps1

    - name: Setup .NET Core
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: 2.2.108
    - run: sudo apt-get install nuget

    - name: Build with dotnet
      run: dotnet build --configuration Release

    - name: Test with dotnet
      run: dotnet test

    - name: Add NuGet source
      run: nuget sources Add -Name "GitHub oledid" -Source "https://nuget.pkg.github.com/oledid/index.json" -UserName oledid -Password ${{ secrets.GITHUB_TOKEN }}

    - name: NuGet pack
      run: pwsh ./NuGet/pack.ps1


name: ASP.NET Core CI

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1

    - name: Write Git Version to file
      uses: docker://gittools/gitversion:5.0.2-beta1-27-linux-centos-7-netcoreapp2.2
      with:
        args: /github/workspace /nofetch /exec /bin/sh /execargs "-c \"echo $GitVersion_FullSemVer > /github/workspace/version.txt\""

    - name: Echo Git version
      run: cat version.txt

    - name: Patch AssemblyInfos
      run: pwsh update-assemblyversion.ps1

    - name: Setup .NET Core
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: 2.2.108
    - run: sudo apt-get install nuget

    - name: Build with dotnet
      run: dotnet build --configuration Release

    - name: Test with dotnet
      run: dotnet test

    - name: Add NuGet source
      run: nuget sources Add -Name "GitHub oledid" -Source "https://nuget.pkg.github.com/oledid/index.json" -UserName oledid -Password ${{ secrets.GITHUB_TOKEN }}

    - name: NuGet pack
      run: pwsh ./NuGet/pack.ps1
      
    - name: Push to GitHub packages
      run: nuget push "oledid.SyntaxImprovement.*.nupkg" -Source "GitHub oledid"


Test pushing to github packages
Test pushing to github packages