Skip to content

Commit

Permalink
Merge pull request #72 from Ken-Tucker/66-add-github-nuget-package
Browse files Browse the repository at this point in the history
Update CI/CD and project files for versioning and SBOM
  • Loading branch information
vb2ae authored Jan 2, 2025
2 parents 8a01a76 + 7b867aa commit e3f76e3
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
fetch-depth: 0


# Initializes the CodeQL tools for scanning.
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
Expand All @@ -25,6 +27,14 @@ jobs:
with:
distribution: 'microsoft'
java-version: 17

- name: Install Microsoft SBom tool
run: dotnet tool install --global Microsoft.Sbom.DotNetTool

- name: Install Nerdbank Git versioning
run: dotnet tool install -g nbgv
- name: Set Version
run: nbgv cloud
- name: search workloads
run: dotnet workload search
- name: restore workloads
Expand All @@ -38,10 +48,12 @@ jobs:
- name: Test
run: dotnet test --configuration Release --no-build --verbosity normal
- name: Pack Nuget
run: dotnet pack ClientNoSqlDB/ClientNoSqlDB.csproj --configuration Release /p:Version=3.0.${{ github.run_attempt }}
run: dotnet pack ClientNoSqlDB/ClientNoSqlDB.csproj --configuration Release
- name: publish Nuget Packages to GitHub
run: dotnet nuget push packages/*.nupkg --source ClientNoSqlDB/bin/Release/*.nupkg --api-key ${{secrets.PUBLISH_NUGET_PACKAGE}} --skip-duplicate
if: github.event_name != 'pull_request'
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: published_nuget
path: ClientNoSqlDB/bin/Release/*.nupkg
if: github.event_name != 'pull_request'
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net9.0-android;net9.0-ios;net9.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>net9.0-android;net9.0-ios;</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->
Expand Down
69 changes: 39 additions & 30 deletions ClientNoSqlDB/ClientNoSqlDB.csproj
Original file line number Diff line number Diff line change
@@ -1,35 +1,44 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net8.0;net9.0</TargetFrameworks>
<PackOnBuild>false</PackOnBuild>
<PackageId>ClientNoSqlDB</PackageId>
<PackageVersion>3.0</PackageVersion>
<Authors>Ken Tucker</Authors>
<NeutralLanguage>en-US</NeutralLanguage>
<Owners>Ken Tucker</Owners>
<PackageProjectUrl>https://github.com/vb2ae/ClientNoSqlDB</PackageProjectUrl>
<Summary>Client No SQL DB that in .net standard library</Summary>
<PackageTags>NoSQL .net standard .net 8</PackageTags>
<Title>Client No SQL DB</Title>
<Description>.net standard version of Lex.DB</Description>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<LangVersion>11</LangVersion>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net8.0;net9.0</TargetFrameworks>
<PackOnBuild>false</PackOnBuild>
<PackageId>ClientNoSqlDB</PackageId>
<PackageVersion>3.0</PackageVersion>
<Authors>Ken Tucker</Authors>
<NeutralLanguage>en-US</NeutralLanguage>
<Owners>Ken Tucker</Owners>
<PackageProjectUrl>https://github.com/vb2ae/ClientNoSqlDB</PackageProjectUrl>
<Summary>Client No SQL DB that in .net standard library</Summary>
<PackageTags>NoSQL .net standard .net 8</PackageTags>
<Title>Client No SQL DB</Title>
<Description>.net standard version of Lex.DB</Description>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<LangVersion>11</LangVersion>
<GenerateSBOM>true</GenerateSBOM>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>ClientNoSqlDB.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<None Include="..\.editorconfig" Link=".editorconfig" />
<None Include="..\LICENSE.md">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<None Include="..\.editorconfig" Link=".editorconfig" />
<None Include="..\LICENSE.md">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Sbom.Targets" Version="3.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
Binary file added ClientNoSqlDB/ClientNoSqlDB.snk
Binary file not shown.
9 changes: 9 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Condition="!Exists('packages.config')">
<PrivateAssets>all</PrivateAssets>
<Version>3.7.112</Version>
</PackageReference>
</ItemGroup>
</Project>
13 changes: 13 additions & 0 deletions version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json",
"version": "1.0-beta",
"publicReleaseRefSpec": [
"^refs/heads/master$",
"^refs/heads/v\\d+(?:\\.\\d+)?$"
],
"cloudBuild": {
"buildNumber": {
"enabled": true
}
}
}

0 comments on commit e3f76e3

Please sign in to comment.