Repository navigation
fix publish #3
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: Build and Publish | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| pull_request: | |
| branches: [ "master" ] | |
| workflow_dispatch: | |
| jobs: | |
| build-and-publish: | |
| name: Build, Test and Publish | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 6.0.x | |
| 8.0.x | |
| - name: Show environment info | |
| run: | | |
| dotnet --version | |
| dotnet nuget list source | |
| - name: Restore dependencies | |
| run: dotnet restore CarbonAPI.Client.sln | |
| - name: Build | |
| run: dotnet build CarbonAPI.Client.sln --no-restore -c Release | |
| - name: Test | |
| run: dotnet test CarbonAPI.Client.sln --no-build -c Release --verbosity normal | |
| - name: Pack | |
| if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master' | |
| run: dotnet pack Client/Client.csproj -c Release -o out --no-build --no-restore | |
| - name: Push to NuGet | |
| if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master' | |
| run: dotnet nuget push out/*.nupkg --source nuget.org --skip-duplicate |