1818 outputs :
1919 version : ${{ steps.dotnet-pack.outputs.version }}
2020 nupkg-filename : ${{ steps.dotnet-pack.outputs.nupkg-filename }}
21+ release-body : ${{ steps.tag-message.outputs.release-notes }}
2122 steps :
2223 - name : Checkout git repository
2324 uses : actions/checkout@v2
4344 with :
4445 name : ${{ steps.dotnet-pack.outputs.nupkg-filename }}
4546 path : ${{ steps.dotnet-pack.outputs.nupkg-filename }}
47+ - name : Retrieve tag message
48+ run : |
49+ git fetch --tags --force
50+ echo "::set-output name=release-notes::$(git tag --list ${{ steps.dotnet-pack.outputs.version }} --format='%(contents)')"
51+ id : tag-message
4652 publish :
4753 runs-on : macos-latest
4854 needs : package
@@ -53,19 +59,19 @@ jobs:
5359 uses : actions/download-artifact@v2
5460 with :
5561 name : ${{ steps.dotnet-pack.outputs.nupkg-filename }}
56- - name : Add GitHub package registry source
57- run : dotnet nuget add source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json --name github --username ${{ github.repository_owner }} --password ${{ github.token }} --store-password-in-clear-text
58- - name : Publish NuGet package on nuget.org
59- run : dotnet nuget push ${{ needs.package.outputs.nupkg-filename }} --source https://api.nuget.org/v3/index.json --api-key "${{ secrets.NUGET_API_KEY }}"
60- - name : Publish NuGet package on github.com
61- run : dotnet nuget push ${{ needs.package.outputs.nupkg-filename }} --source github
6262 - name : Create GitHub Release
6363 uses : actions/create-release@v1
6464 env :
6565 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
6666 with :
6767 tag_name : ${{ needs.package.outputs.version }}
6868 release_name : Version ${{ needs.package.outputs.version }}
69- body : ${{ github.event.head_commit.message }}
69+ body : ${{ needs.package.outputs.release-body }}
7070 draft : false
7171 prerelease : ${{ contains(needs.package.outputs.version, '-') }}
72+ - name : Add GitHub package registry source
73+ run : dotnet nuget add source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json --name github --username ${{ github.repository_owner }} --password ${{ github.token }} --store-password-in-clear-text
74+ - name : Publish NuGet package on github.com
75+ run : dotnet nuget push ${{ needs.package.outputs.nupkg-filename }} --source github
76+ - name : Publish NuGet package on nuget.org
77+ run : dotnet nuget push ${{ needs.package.outputs.nupkg-filename }} --source https://api.nuget.org/v3/index.json --api-key "${{ secrets.NUGET_API_KEY }}"
0 commit comments