Skip to content

Commit

Permalink
Merge pull request #7 from authzed/3-add-nuget-release
Browse files Browse the repository at this point in the history
Add Nuget release process
  • Loading branch information
tstirrat15 authored Sep 5, 2024
2 parents 9daf07f + 6d77f75 commit 07c7a02
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 8 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "Publish to Nuget"
on:
release:
types:
- "published"
jobs:
publish:
name: "Publish to Nuget"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
- uses: "actions/setup-dotnet@v4"
with:
dotnet-version: '8.x'
# Store the version, stripping any v-prefix
# This lets us use v-prefixed releases
- name: Write release version
run: |
VERSION=${GITHUB_REF_NAME#v}
echo Version: $VERSION
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: "Pack the project"
working-directory: "src/Authzed.Net"
run: "dotnet pack -c Release -o dist -p:PackageVersion=${VERSION} -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -p:ContinuousIntegrationBuild=true"
- name: "Publish to Nuget"
working-directory: "src/Authzed.Net/dist"
run: 'dotnet nuget push *.nupkg -s https://api.nuget.org/v3/index.json -k "${{ secrets.NUGET_API_KEY }}" --skip-duplicate'
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
Debug
src/Authzed.Net/bin
src/Authzed.Net/out
src/Authzed.Net/dist
src/Authzed.Net/obj/Release
5 changes: 0 additions & 5 deletions examples/protected-api/Api/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,3 @@ void ConfigureSpiceDbChannel(IServiceProvider provider, GrpcChannelOptions optio
.WithOpenApi();

app.Run();

record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary)
{
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
}
28 changes: 28 additions & 0 deletions src/Authzed.Net/Authzed.Net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,29 @@
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<PackageId>Authzed.Net</PackageId>
<!-- NOTE: This gets overridden by a CLI flag on publish. -->
<Version>0.1.0-alpha</Version>

<Description>
This client library enables working with the SpiceDB centralized authorization system.
For documentation, see https://authzed.com/docs or the README at https://github.com/authzed/authzed-dotnet.
For the changelog for this library, see the github releases: https://github.com/authzed/authzed-dotnet/releases
</Description>

<PackageTags>authzed;authz;authorization;zanzibar;spicedb;spicedb client</PackageTags>
<Authors>Employees of Authzed, Inc</Authors>
<Copyright>Copyright © Authzed, Inc 2024</Copyright>
<Company>Authzed, Inc</Company>

<PackageProjectUrl>https://authzed.com</PackageProjectUrl>
<RepositoryUrl>https://github.com/authzed/authzed-dotnet</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<!-- TODO: -->
<!--<PackageIcon>Icon.png</PackageIcon>-->
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup>
Expand All @@ -14,6 +37,11 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>

<None Include="$(MSBuildThisFileDirectory)..\..\LICENSE" Pack="true" PackagePath=""/>
<None Include="$(MSBuildThisFileDirectory)..\..\README.md" Pack="true" PackagePath=""/>
<!-- TODO: -->
<!--<None Include="$(MSBuildThisFileDirectory)..\..\Icon.png" Pack="true" PackagePath=""/>-->
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/Authzed.Net/obj/Authzed.Net.csproj.nuget.dgspec.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
"projects": {
"/home/tstirrat/authzed/authzed-dotnet/src/Authzed.Net/Authzed.Net.csproj": {
"version": "1.0.0",
"version": "0.1.0-alpha",
"restore": {
"projectUniqueName": "/home/tstirrat/authzed/authzed-dotnet/src/Authzed.Net/Authzed.Net.csproj",
"projectName": "Authzed.Net",
Expand Down
2 changes: 1 addition & 1 deletion src/Authzed.Net/obj/project.assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@
"/home/tstirrat/.nuget/packages/": {}
},
"project": {
"version": "1.0.0",
"version": "0.1.0-alpha",
"restore": {
"projectUniqueName": "/home/tstirrat/authzed/authzed-dotnet/src/Authzed.Net/Authzed.Net.csproj",
"projectName": "Authzed.Net",
Expand Down
2 changes: 1 addition & 1 deletion src/Authzed.Net/obj/project.nuget.cache
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": 2,
"dgSpecHash": "zq5AA1voT2FFJPY+wp/gQKLdR11pQuZmbalwHSDET+IBQXpcAAFiJhCXO+kHhu2an8Kr5+yvmUiOfrFcL5l8pw==",
"dgSpecHash": "D+iZ1elM89+JueRx+i69wfXeLlHYwCO/U/fwsKHlopBjb6LM2kWs7cjp9AHwUTDesOaveWzzvhhGsU4MgV+HuQ==",
"success": true,
"projectFilePath": "/home/tstirrat/authzed/authzed-dotnet/src/Authzed.Net/Authzed.Net.csproj",
"expectedPackageFiles": [
Expand Down

0 comments on commit 07c7a02

Please sign in to comment.