Skip to content

Commit

Permalink
Add sourcelink and snupkg. Remove redundant directory.build.props
Browse files Browse the repository at this point in the history
  • Loading branch information
hallipr committed Jun 5, 2024
1 parent 41f8cb8 commit b1afe27
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 31 deletions.
17 changes: 14 additions & 3 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,21 @@ https://docs.github.com/en/actions/automating-builds-and-tests/building-and-test
- Strong name the assemblies using a key stored in the repository
https://github.com/dotnet/runtime/blob/main/docs/project/strong-name-signing.md
- Test the built libraries
- Use a repository secret to hold the OpenAI token used for live testing
- In a PR run, only local tests are run.
- In a CI run, live tests are run using a repository secret containing an OpenAI token
https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions
- Package the built libraries
- Publish the package as a GitHub Release
- Publish the package to a GitHub NuGet registry
https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry
- Publish a single build artifact containing test results and a nuget package
- Publish a single build artifact containing test results and a nuget package

## release.yml
Releases are triggered by publishing a release in the GitHub repository. The release workflow will:

- Build the solution using the dotnet cli
- Strong name the assemblies using a key stored in the repository
- Test the built libraries
- Live tests are run using a repository secret containing an OpenAI token
- Package the built libraries
- Publish the package to public NuGet registry
- Publish a single build artifact containing test results and a nuget package
13 changes: 2 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,9 @@ jobs:
name: build-artifacts
path: ${{github.workspace}}/artifacts

# - name: NuGet Autenticate
# run: dotnet nuget add source
# "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
# --name "github"
# --username ${{ github.actor }}
# --password ${{ secrets.GITHUB_TOKEN }}
# --store-password-in-clear-text

# - name: Publish
# run: dotnet nuget push
# ${{github.workspace}}/artifacts/packages/*.nupkg
# --source "github"
# --api-key ${{ secrets.GITHUB_TOKEN }}
# --source https://api.nuget.org/v3/index.json
# --api-key ${{ secrets.NUGET_API_KEY }}
# --skip-duplicate
# working-directory: .dotnet
8 changes: 0 additions & 8 deletions src/Directory.Build.props

This file was deleted.

30 changes: 27 additions & 3 deletions src/OpenAI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,40 @@
<PropertyGroup>
<Description>This is the OpenAI client library for developing .NET applications with rich experience.</Description>
<AssemblyTitle>SDK Code Generation OpenAI</AssemblyTitle>
<PackageTags>OpenAI</PackageTags>

<VersionPrefix>2.0.0</VersionPrefix>
<VersionSuffix>beta.1</VersionSuffix>
<PackageTags>OpenAI</PackageTags>

<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
<LangVersion>latest</LangVersion>

<!-- Sign the assembly with the specified key file. -->
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>OpenAI.snk</AssemblyOriginatorKeyFile>

<!-- Generate an XML documentation file for the project. -->
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<SignAssembly>False</SignAssembly>

<!-- Publish the repository URL in the built .nupkg (in the NuSpec <Repository> element) -->
<PublishRepositoryUrl>true</PublishRepositoryUrl>

<!-- Create a .snupkg file in addition to the .nupkg file. -->
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>

<!-- Embed source files that are not tracked by the source control manager in the PDB -->
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>

<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<!-- Normalize stored file paths in symbols when in a CI build. -->
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="System.ClientModel" Version="1.1.0-beta.4" />
<PackageReference Include="System.Text.Json" Version="8.0.2" />
</ItemGroup>
</Project>
</Project>
6 changes: 0 additions & 6 deletions src/Properties/AssemblyInfo.cs

This file was deleted.

0 comments on commit b1afe27

Please sign in to comment.