diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml new file mode 100644 index 0000000..de516cf --- /dev/null +++ b/.github/workflows/dotnet.yml @@ -0,0 +1,36 @@ +# 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: Build and Publish + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + env: + SOLUTION: /src/Spectre.Console.Extensions.Hosting.sln + PROJECT: /src/Spectre.Console.Extensions.Hosting/Spectre.Console.Extensions.Hosting.csproj + CONFIG: Release + + steps: + - uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8.0.x + - name: Restore dependencies + run: dotnet restore ${{ env.SOLUTION }} --no-cache + - name: Build + run: dotnet build ${{ env.SOLUTION }} --no-restore -c ${{ env.CONFIG }} + - name: Test + run: dotnet test ${{ env.SOLUTION }} --no-build --verbosity normal --configuration ${{ env.CONFIG }} + - name: Package + run: dotnet pack ${{ env.PROJECT }} -c ${{ env.CONFIG }} --output ./publish + diff --git a/.gitignore b/.gitignore index 8a30d25..85bb813 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ *.userosscache *.sln.docstates + # User-specific files (MonoDevelop/Xamarin Studio) *.userprefs