Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Nuget release process #7

Merged
merged 11 commits into from
Sep 5, 2024
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
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
Loading