Add ChatGptClientFactory (#150) #46
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish ChatGPT for .NET on NuGet | |
on: | |
push: | |
branches: [ master ] | |
paths: [ 'src/**' ] | |
workflow_dispatch: | |
env: | |
NET_VERSION: '8.x' | |
PROJECT_NAME: src/ChatGptNet | |
PROJECT_FILE: ChatGptNet.csproj | |
RELEASE_NAME: ChatGptNet | |
jobs: | |
publish: | |
name: Publish on NuGet | |
runs-on: ubuntu-latest | |
if: ${{ github.repository_owner == vars.REPOSITORY_OWNER }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # avoid shallow clone so nbgv can do its work. | |
- name: Setup .NET SDK ${{ env.NET_VERSION }} | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: ${{ env.NET_VERSION }} | |
dotnet-quality: 'ga' | |
- name: Nerdbank.GitVersioning | |
uses: dotnet/nbgv@v0.4 | |
id: nbgv | |
with: | |
path: ${{ env.PROJECT_NAME }} | |
- name: Package | |
run: dotnet pack -c Release -o . '${{ env.PROJECT_NAME }}/${{ env.PROJECT_FILE }}' | |
- name: Publish on NuGet | |
run: dotnet nuget push *.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json | |
- name: Create release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} | |
with: | |
tag_name: v${{ steps.nbgv.outputs.NuGetPackageVersion }} | |
release_name: ${{ env.RELEASE_NAME }} ${{ steps.nbgv.outputs.NuGetPackageVersion }} | |
draft: false | |
prerelease: false |