Skip to content

Commit 3aaef70

Browse files
authored
Update dotnet.yml
1 parent 35fac9f commit 3aaef70

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

.github/workflows/dotnet.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@ jobs:
5656
run: dotnet build --no-restore -c Release
5757
- name: Test
5858
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
5967

6068
sonarcloud:
6169
name: Build and analyze with SonarCloud
@@ -98,27 +106,29 @@ jobs:
98106
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
99107
shell: powershell
100108
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"
102109
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"
103111
dotnet restore
104112
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 }}"
107114
108115
publish-nuget:
109116
name: Publish the NuGet package
110117
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-')
111119
runs-on: ubuntu-latest
112120
steps:
121+
- name: Download a single artifact
122+
uses: actions/download-artifact@v3
123+
with:
124+
name: release-buid
113125
- name: Setup dotNET
114126
uses: actions/setup-dotnet@v3
115127
with:
116128
dotnet-version: 7.x
117129
- name: Publish the package to nuget.org
118130
run: |
119131
ls -la
120-
cd jjm.one.Serilog.Extensions.Logging.Helpers
121-
ls -la
122132
#run: dotnet nuget push */bin/Release/*.nupkg -k $NUGET_AUTH_TOKEN -s https://api.nuget.org/v3/index.json
123133
#env:
124134
# NUGET_AUTH_TOKEN: ${{ secrets.NUGET_TOKEN }}

0 commit comments

Comments
 (0)