Merge pull request #1 from tarrball/atarr/main/search-tests #10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy to NuGet | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths: | |
| - 'GuardianClient/GuardianClient/**' | |
| - '!GuardianClient/GuardianClient.Tests/**' | |
| pull_request: | |
| branches: [ main ] | |
| paths: | |
| - 'GuardianClient/GuardianClient/**' | |
| - '!GuardianClient/GuardianClient.Tests/**' | |
| env: | |
| PROJECT_PATH: 'GuardianClient/GuardianClient/GuardianClient.csproj' | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Restore dependencies | |
| run: dotnet restore ${{ env.PROJECT_PATH }} | |
| - name: Build | |
| run: dotnet build ${{ env.PROJECT_PATH }} --no-restore --configuration Release | |
| - name: Test | |
| run: dotnet test ${{ env.PROJECT_PATH }} --no-build --configuration Release --verbosity normal | |
| deploy: | |
| needs: build-and-test | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Restore dependencies | |
| run: dotnet restore ${{ env.PROJECT_PATH }} | |
| - name: Build | |
| run: dotnet build ${{ env.PROJECT_PATH }} --no-restore --configuration Release | |
| - name: Pack | |
| run: dotnet pack ${{ env.PROJECT_PATH }} --no-build --configuration Release --output ./artifacts | |
| - name: Push to NuGet | |
| run: dotnet nuget push ./artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate |