Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .dotnet/nuget.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
<add key="DevelopmentFeed" value="https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json" />
</packageSources>
</configuration>
21 changes: 21 additions & 0 deletions .dotnet/scripts/Update-Client.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
$repoRoot = Join-Path $PSScriptRoot .. .. -Resolve
$dotnetFolder = Join-Path $repoRoot .dotnet

function Invoke([scriptblock]$script) {
$scriptString = $script | Out-String
Write-Host "--------------------------------------------------------------------------------`n> $scriptString"
& $script
}

Push-Location $repoRoot
try {
Invoke { npm ci }
Invoke { npm exec --no -- tsp compile main.tsp --emit @typespec/openapi3 }
Invoke { npm exec --no -- tsp compile main.tsp --emit @azure-tools/typespec-csharp --option @azure-tools/typespec-csharp.emitter-output-dir="$dotnetFolder" }
Invoke { .dotnet\scripts\Update-ClientModel.ps1 }
Invoke { .dotnet\scripts\ConvertTo-Internal.ps1 }
Invoke { .dotnet\scripts\Add-Customizations.ps1 }
}
finally {
Pop-Location
}
6 changes: 6 additions & 0 deletions .dotnet/src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>OpenAI.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
</Project>
Binary file added .dotnet/src/OpenAI.snk
Binary file not shown.
28 changes: 28 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Validate OpenAPI definition
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
types: [opened, reopened, synchronize]

Expand All @@ -25,3 +29,27 @@ jobs:
with:
swagger-editor-url: http://localhost/
definition-file: openapi.yaml

# Test, pack and publish the Open AI nuget package as a build artifact
build:
runs-on: ubuntu-latest
steps:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.x

- name: Checkout code
uses: actions/checkout@v2


- name: Pack
run: dotnet pack -c Release -o out
working-directory: .dotnet

- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: package
path: out/*.nupkg
if: ${{ github.event_name != 'pull_request' }}