Prod 3684 more instrumentation slim down (#21) #112
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
| # 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: .NET | |
| on: | |
| push: | |
| branches: [ "main", "release/*", "feature/*", "bugfix/*" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 8.0.x | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Extract branch name if release | |
| if: startsWith(github.ref, 'refs/heads/release') != true | |
| shell: bash | |
| run: echo "BRANCH=0.0.1" >> $GITHUB_ENV | |
| - name: Extract branch name if not release | |
| if: startsWith(github.ref, 'refs/heads/release') | |
| shell: bash | |
| run: echo "BRANCH=$(echo $GITHUB_REF | cut -d '/' -f 4)" >> $GITHUB_ENV | |
| - name: Build | |
| run: dotnet build --no-restore /property:Version=${{ env.BRANCH }} | |
| - name: Test | |
| run: dotnet test --no-build --verbosity normal --filter "TestCategory!=Integration" | |
| - name: Publish | |
| if: startsWith(github.ref, 'refs/heads/release') | |
| run: dotnet nuget push **\*.nupkg --source 'https://api.nuget.org/v3/index.json' --api-key ${{secrets.NUGET_API_KEY}} | |