11# This workflow is triggered by new releases and on a daily schedule.
2- # It builds, unit tests, live tests and published the Open AI nuget package.
2+ # It builds, unit tests, live tests and publishes the Open AI NuGet package.
33# For daily runs, the package is published to the GitHub package registry.
44# For releases, the package is published to the NuGet package registry.
55name : Release package
1111 # run every day at 00:00
1212 - cron : ' 0 0 * * *'
1313
14+ permissions :
15+ contents : write
16+ packages : write
17+
1418jobs :
1519 build :
1620 name : Build
1721 runs-on : ubuntu-latest
1822 environment : Live Testing
1923 env :
2024 version_suffix_args : ${{ github.event_name == 'schedule' && format('/p:VersionSuffix="alpha.{0}"', github.run_number) || '' }}
21- permissions :
22- packages : write
23- contents : write
2425 steps :
2526 - name : Setup .NET
2627 uses : actions/setup-dotnet@v3
3536 - name : Checkout code
3637 uses : actions/checkout@v2
3738
38- # Pack the client nuget package and include url back to the repository and release tag
39+ # Pack the client NuGet package and include URL back to the repository and release tag
3940 - name : Build and Pack
4041 run : dotnet pack
4142 --configuration Release
8687 env :
8788 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
8889
90+ - name : Update GitHub release notes to point to the changelog
91+ if : github.event_name == 'release'
92+ run : |
93+ gh release edit "${{ github.event.release.tag_name }}" \
94+ --notes "See full changelog: ${{ github.server_url }}/${{ github.repository }}/blob/${{ github.event.release.tag_name }}/CHANGELOG.md"
95+
8996 - name : NuGet authenticate
9097 run : dotnet nuget add source
9198 " https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
@@ -96,15 +103,15 @@ jobs:
96103
97104 - name : Publish package to local feed
98105 run : dotnet nuget push
99- ${{github.workspace}}/build-artifacts/packages/*.nupkg
106+ ${{ github.workspace }}/build-artifacts/packages/*.nupkg
100107 --source "github"
101108 --api-key ${{ secrets.GITHUB_TOKEN }}
102109 --skip-duplicate
103110
104111 - name : Publish package to nuget.org
105112 if : github.event_name == 'release'
106113 run : dotnet nuget push
107- ${{github.workspace}}/build-artifacts/packages/*.nupkg
114+ ${{ github.workspace }}/build-artifacts/packages/*.nupkg
108115 --source https://api.nuget.org/v3/index.json
109116 --api-key ${{ secrets.NUGET_API_KEY }}
110117 --skip-duplicate
0 commit comments