|
56 | 56 | run: dotnet build --no-restore -c Release |
57 | 57 | - name: Test |
58 | 58 | run: dotnet test --no-build --verbosity normal |
| 59 | + - name: Upload artifact |
| 60 | + uses: actions/upload-artifact@v3 |
| 61 | + with: |
| 62 | + name: release-buid |
| 63 | + path: | |
| 64 | + ./bin |
| 65 | + ./obj |
| 66 | + retention-days: 1 |
59 | 67 |
|
60 | 68 | sonarcloud: |
61 | 69 | name: Build and analyze with SonarCloud |
@@ -98,27 +106,29 @@ jobs: |
98 | 106 | SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
99 | 107 | shell: powershell |
100 | 108 | run: | |
101 | | - .\.sonar\scanner\dotnet-sonarscanner begin /k:"jjm-one_jjm.one.Serilog.Extensions.Logging.Helpers" /o:"jjm-one" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" |
102 | 109 | cd .\src |
| 110 | + .\..\.sonar\scanner\dotnet-sonarscanner begin /k:"jjm-one_jjm.one.Serilog.Extensions.Logging.Helpers" /o:"jjm-one" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" |
103 | 111 | dotnet restore |
104 | 112 | dotnet build --no-restore |
105 | | - cd .. |
106 | | - .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}" |
| 113 | + .\..\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}" |
107 | 114 |
|
108 | 115 | publish-nuget: |
109 | 116 | name: Publish the NuGet package |
110 | 117 | needs: [build-and-test-debug, build-and-test-release, sonarcloud, publish-doc] |
| 118 | + if: github.ref_type == 'tag' && startsWith(github.event.ref, 'refs/tags/version-') |
111 | 119 | runs-on: ubuntu-latest |
112 | 120 | steps: |
| 121 | + - name: Download a single artifact |
| 122 | + uses: actions/download-artifact@v3 |
| 123 | + with: |
| 124 | + name: release-buid |
113 | 125 | - name: Setup dotNET |
114 | 126 | uses: actions/setup-dotnet@v3 |
115 | 127 | with: |
116 | 128 | dotnet-version: 7.x |
117 | 129 | - name: Publish the package to nuget.org |
118 | 130 | run: | |
119 | 131 | ls -la |
120 | | - cd jjm.one.Serilog.Extensions.Logging.Helpers |
121 | | - ls -la |
122 | 132 | #run: dotnet nuget push */bin/Release/*.nupkg -k $NUGET_AUTH_TOKEN -s https://api.nuget.org/v3/index.json |
123 | 133 | #env: |
124 | 134 | # NUGET_AUTH_TOKEN: ${{ secrets.NUGET_TOKEN }} |
|
0 commit comments