@@ -11,44 +11,53 @@ jobs:
11
11
runs-on : windows-latest
12
12
13
13
steps :
14
+ - uses : actions/checkout@v2
14
15
- name : Get the version
15
16
id : get_version
16
- run : echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/releases\//}
17
- shell : bash
18
- - uses : actions/checkout@v2
19
- - name : Setup .NET
20
- uses : actions/setup-dotnet@v1
17
+ uses :
mavrosxristoforos/[email protected]
21
18
with :
22
- dotnet-version : |
23
- 3.1.x
24
- 6.0.x
19
+ xml-file : ' ./Directory.Build.props'
20
+ xpath : ' //Version'
21
+ - name : Create short version
22
+ id : shortversion
23
+ run : |
24
+ $version = "${{ steps.get_version.outputs.info }}".Substring(0, "${{ steps.get_version.outputs.info }}".LastIndexOf("."))
25
+ Write-Host "::set-output name=shortversion::$version"
26
+ shell : pwsh
27
+ - uses : actions/checkout@v2
25
28
- name : Restore dependencies
26
29
run : dotnet restore
27
30
- name : Build
28
31
run : dotnet build --no-restore -c Release .\Serilog.Enrichers.Sensitive.sln
29
32
- name : Test
30
33
run : dotnet test --no-build --verbosity normal -c Release
31
- - name : Create NuGet package
32
- run : dotnet pack ./src/Serilog.Enrichers.Sensitive/Serilog.Enrichers.Sensitive.csproj -c Release --no-build --no-restore
34
+ - name : Create NuGet package for Serilog.Enrichers.Sensitive
35
+ run : dotnet pack ./src/Serilog.Enrichers.Sensitive/Serilog.Enrichers.Sensitive.csproj -c Release --no-build --no-restore -o ./packaging
36
+ - name : Get changelog
37
+ id : get_changelog
38
+ run : |
39
+ ./get-changelog.ps1 -currentVersion "${{ steps.get_version.outputs.info }}"
40
+ shell : pwsh
33
41
- name : Create Release
34
42
id : create_release
35
43
uses : actions/create-release@v1
36
44
env :
37
45
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
38
46
with :
39
- tag_name : ${{ steps.get_version.outputs.VERSION }}
40
- release_name : ${{ steps.get_version.outputs.VERSION }}
47
+ tag_name : ${{ steps.get_version.outputs.info }}
48
+ release_name : ${{ steps.get_version.outputs.info }}
41
49
draft : false
42
50
prerelease : false
43
- - name : Upload NuGet package
44
- id : upload-release-asset
51
+ body_path : ./version-changelog.md
52
+ - name : Upload enricher NuGet package
53
+ id : upload-nuget-enricher
45
54
uses : actions/upload-release-asset@v1
46
55
env :
47
56
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
48
57
with :
49
58
upload_url : ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
50
- asset_path : ./packaging/Serilog.Enrichers.Sensitive.${{ steps.get_version .outputs.VERSION }}.nupkg
51
- asset_name : Serilog.Enrichers.Sensitive.${{ steps.get_version .outputs.VERSION }}.nupkg
59
+ asset_path : ./packaging/Serilog.Enrichers.Sensitive.${{ steps.shortversion .outputs.shortversion }}.nupkg
60
+ asset_name : Serilog.Enrichers.Sensitive.${{ steps.shortversion .outputs.shortversion }}.nupkg
52
61
asset_content_type : application/octet-stream
53
- - name : Publish package to public NuGet repository
54
- run : dotnet nuget push -k ${{ secrets.NUGET_TOKEN }} ./ packaging/Serilog.Enrichers.Sensitive.${{ steps.get_version .outputs.VERSION }}.nupkg --skip-duplicate --no-symbols true
62
+ - name : Publish enricher package to public NuGet repository
63
+ run : dotnet nuget push -k ${{ secrets.NUGET_TOKEN }} -s https://api.nuget.org/v3/index.json ./ packaging/Serilog.Enrichers.Sensitive.${{ steps.shortversion .outputs.shortversion }}.nupkg --skip-duplicate --no-symbols
0 commit comments