@@ -12,66 +12,62 @@ jobs:
1212 if : " ! contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
1313
1414 steps :
15-
1615 - name : Checkout
1716 uses : actions/checkout@master
17+ with :
18+ fetch-depth : 0
1819
1920 - name : Extract branch name
2021 id : extract_branch
2122 shell : powershell
2223 run : Write-Host ([string]::Format("##[set-output name=branch;]{0}", $env:GITHUB_REF.Replace("refs/heads/", "")))
24+
25+ - name : Install GitVersion
26+ uses : gittools/actions/gitversion/setup@v0.9.7
27+ with :
28+ versionSpec : ' 5.5.1'
29+
30+ - name : Determine Version
31+ id : gitversion
32+ uses : gittools/actions/gitversion/execute@v0.9.7
33+ with :
34+ useConfigFile : true
35+
36+ - name : Install NuGet client
37+ uses : nuget/setup-nuget@v1
38+ with :
39+ nuget-version : ' 5.x'
2340
2441 - name : Run the Cake script
2542 id : cake
26- uses : ecampidoglio /cake-action@master
43+ uses : cake-build /cake-action@master
2744 with :
2845 cake-bootstrap : true
29-
30- - name : Install NuGet client
31- uses : warrenbuckley/Setup-Nuget@v1
46+ verbosity : Diagnostic
47+ arguments : |
48+ fullSemVer: ${{steps.gitversion.outputs.fullSemVer}}
49+ assemblySemVer: ${{steps.gitversion.outputs.assemblySemVer}}
50+ informationalVersion: ${{steps.gitversion.outputs.informationalVersion}}
3251
3352 - name : Add private GitHub registry to NuGet
3453 run : nuget sources add -name "GPR" -Source https://nuget.pkg.github.com/dustinchilson/index.json -Username dustinchilson -Password ${{ secrets.GITHUB_TOKEN }}
3554
3655 - name : Push generated package to GitHub registry
37- run : nuget push ./artifacts/NLog.Targets.GraylogHttp.${{ env.GIT_VERSION }}.nupkg -Source "GPR" -SkipDuplicate
56+ run : nuget push ./artifacts/NLog.Targets.GraylogHttp.${{steps.gitversion.outputs.fullSemVer }}.nupkg -Source "GPR" -SkipDuplicate
3857
3958 - name : Push generated package to nuget.org
4059 if : steps.extract_branch.outputs.branch == 'main'
41- run : nuget push ./artifacts/NLog.Targets.GraylogHttp.${{ env.GIT_VERSION }}.nupkg -ApiKey ${{ secrets.NUGET_ORG_API_KEY }} -Source https://api.nuget.org/v3/index.json
60+ run : nuget push ./artifacts/NLog.Targets.GraylogHttp.${{steps.gitversion.outputs.fullSemVer }}.nupkg -ApiKey ${{secrets.NUGET_ORG_API_KEY}} -Source https://api.nuget.org/v3/index.json
4261
4362 - name : Create Release
4463 if : steps.extract_branch.outputs.branch == 'main'
4564 id : create_release
4665 uses : actions/create-release@master
4766 env :
48- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
67+ GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN}}
4968 with :
50- tag_name : v${{ env.GIT_VERSION }}
51- release_name : Release v${{ env.GIT_VERSION }}
69+ tag_name : v${{steps.gitversion.outputs.fullSemVer }}
70+ release_name : Release v${{steps.gitversion.outputs.fullSemVer }}
5271 draft : false
5372 prerelease : false
54-
55- - name : Upload Test Results
56- if : steps.extract_branch.outputs.branch == 'main'
57- id : upload-test-results
58- uses : actions/upload-release-asset@master
59- env :
60- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
61- with :
62- upload_url : ${{ steps.create_release.outputs.upload_url }}
63- asset_path : ./artifacts/TestResults.xml
64- asset_name : TestResults.xml
65- asset_content_type : application/xml
66-
67- - name : Upload Nuget Package
68- if : steps.extract_branch.outputs.branch == 'main'
69- id : upload-nuget-package
70- uses : actions/upload-release-asset@master
71- env :
72- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
73- with :
74- upload_url : ${{ steps.create_release.outputs.upload_url }}
75- asset_path : ./artifacts/NLog.Targets.GraylogHttp.${{ env.GIT_VERSION }}.nupkg
76- asset_name : NLog.Targets.GraylogHttp.${{ env.GIT_VERSION }}.nupkg
77- asset_content_type : application/xml
73+ body : https://www.nuget.org/packages/NLog.Targets.GraylogHttp/${{steps.gitversion.outputs.fullSemVer}}
0 commit comments