@@ -21,19 +21,13 @@ jobs:
2121 dotnet-version : 6.0.x
2222 - name : Restore dependencies
2323 run : dotnet restore
24-
25- - name : Fiddeling with secrets
26- if : env.NUGET_TOKEN_EXISTS != ''
27- run : echo "NUGET_TOKEN_EXISTS exists - implementation of secret checking working on all runners"
2824 - name : Build
2925 run : dotnet build --configuration Release --no-restore
3026 - name : Test
3127 run : dotnet test --no-build --verbosity normal --configuration Release
3228
3329 deployRelease :
34- env :
35- NUGET_TOKEN_EXISTS : ${{ secrets.NUGET_TOKEN }}
36- if : github.ref == 'refs/heads/main' && ${{ env.NUGET_TOKEN_EXISTS != '' }}
30+ if : github.ref == 'refs/heads/main'
3731 runs-on : ubuntu-latest
3832 needs : build
3933 steps :
@@ -47,10 +41,17 @@ jobs:
4741 - name : Build
4842 run : dotnet build --configuration Release --no-restore
4943 - name : NugetPush
44+ env :
45+ NUGET_TOKEN_EXISTS : ${{ secrets.NUGET_TOKEN }}
46+ if : env.NUGET_TOKEN_EXISTS != ''
5047 run : |
5148 ls ./GithubActionsHelloWorld/bin/Release
5249 dotnet nuget push ./GithubActionsHelloWorld/bin/Release/*.nupkg --skip-duplicate --api-key ${{secrets.NUGET_TOKEN}} --source https://apiint.nugettest.org/v3/index.json
53- - uses : " marvinpinto/action-automatic-releases@latest"
50+ - name : Github release
51+ env :
52+ GITHUB_TOKEN_EXISTS : ${{ secrets.GITHUB_TOKEN }}
53+ if : env.GITHUB_TOKEN_EXISTS != ''
54+ uses : " marvinpinto/action-automatic-releases@latest"
5455 with :
5556 repo_token : " ${{ secrets.GITHUB_TOKEN }}"
5657 automatic_release_tag : " ${{ env.CURRENT_VERSION }}"
6162 ./GithubActionsHelloWorld/bin/Release/*.snupkg
6263
6364 deployTest :
64- env :
65- NUGET_TOKEN_TEST_EXISTS : ${{ secrets.NUGET_TEST_TOKEN }}
66- if : github.ref != 'refs/heads/main' && ${{ env.NUGET_TOKEN_TEST_EXISTS != '' }}
6765 runs-on : ubuntu-latest
6866 needs : build
6967 steps :
@@ -77,10 +75,17 @@ jobs:
7775 - name : Build
7876 run : dotnet build --configuration Release --no-restore
7977 - name : NugetPush
78+ env :
79+ NUGET_TOKEN_TEST_EXISTS : ${{ secrets.NUGET_TEST_TOKEN }}
80+ if : env.NUGET_TOKEN_TEST_EXISTS != ''
8081 run : |
8182 ls ./GithubActionsHelloWorld/bin/Release
8283 dotnet nuget push ./GithubActionsHelloWorld/bin/Release/*.nupkg --skip-duplicate --api-key ${{secrets.NUGET_TEST_TOKEN}} --source https://apiint.nugettest.org/v3/index.json
83- - uses : " marvinpinto/action-automatic-releases@latest"
84+ - name : Github release
85+ env :
86+ GITHUB_TOKEN_EXISTS : ${{ secrets.GITHUB_TOKEN }}
87+ if : env.GITHUB_TOKEN_EXISTS != ''
88+ uses : " marvinpinto/action-automatic-releases@latest"
8489 with :
8590 repo_token : " ${{ secrets.GITHUB_TOKEN }}"
8691 automatic_release_tag : " ${{ env.CURRENT_VERSION }}"
0 commit comments