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
10 changes: 9 additions & 1 deletion .github/workflows/publish_nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ on:
description: 'NuGet package version to publish (optional, will read from project if not set)'
required: false
type: string
workflow_call:
inputs:
version:
description: 'NuGet package version to publish (optional, will read from project if not set)'
required: false
type: string

jobs:
publish:
Expand Down Expand Up @@ -38,7 +44,9 @@ jobs:
--name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"

- name: Restore dependencies
run: dotnet restore
run: |
dotnet restore DataPlane.Sdk.Core/DataPlane.Sdk.Core.csproj
dotnet restore DataPlane.Sdk.Api/DataPlane.Sdk.Api.csproj

- name: Get version
id: get_version
Expand Down
109 changes: 109 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Create Release

on:
workflow_dispatch:
inputs:
version:
description: 'Release version (e.g., 1.0.0 or v1.0.0)'
required: true
type: string

jobs:
create-tag:
name: Create Tag
runs-on: ubuntu-latest

permissions:
contents: write

outputs:
version: ${{ steps.normalize_version.outputs.version }}
tag: ${{ steps.normalize_version.outputs.tag }}

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Normalize version
id: normalize_version
run: |
version="${{ github.event.inputs.version }}"
# Remove 'v' prefix if present
version="${version#v}"
# Add 'v' prefix for tag
tag="v${version}"
echo "version=$version" >> $GITHUB_OUTPUT
echo "tag=$tag" >> $GITHUB_OUTPUT

- name: Check if tag exists
run: |
if git rev-parse "${{ steps.normalize_version.outputs.tag }}" >/dev/null 2>&1; then
echo "Error: Tag ${{ steps.normalize_version.outputs.tag }} already exists"
exit 1
fi

- name: Update version in .csproj files
run: |
# Find all .csproj files with <Version> tags and update them
find . -name "*.csproj" -type f | while read file; do
if grep -q "<Version>" "$file"; then
sed -i.bak "s|<Version>.*</Version>|<Version>${{ steps.normalize_version.outputs.version }}</Version>|g" "$file"
rm "${file}.bak"
echo "Updated version in $file"
fi
done

- name: Commit version bump
run: |
git add "*.csproj"
if git diff --cached --quiet; then
echo "No version changes to commit"
else
git commit -m "chore: bump version to ${{ steps.normalize_version.outputs.version }}"
git push origin HEAD
fi

- name: Create and push tag
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -a "${{ steps.normalize_version.outputs.tag }}" -m "Release ${{ steps.normalize_version.outputs.tag }}"
git push origin "${{ steps.normalize_version.outputs.tag }}"

publish-nuget:
name: Publish NuGet Packages
needs: create-tag
uses: ./.github/workflows/publish_nuget.yml
with:
version: ${{ needs.create-tag.outputs.version }}
permissions:
packages: write
contents: read

create-release:
name: Create GitHub Release
needs: [create-tag, publish-nuget]
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
tag: ${{ needs.create-tag.outputs.tag }}
name: Release ${{ needs.create-tag.outputs.tag }}
generateReleaseNotes: true
body: |
NuGet packages published to GitHub Packages.

### Installation
```bash
dotnet add package DataPlane.Sdk.Core --version ${{ needs.create-tag.outputs.version }}
dotnet add package DataPlane.Sdk.Api --version ${{ needs.create-tag.outputs.version }}
```
draft: false
prerelease: false
32 changes: 17 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,23 @@ Planes via the Data Plane Signaling API (DPS API). The SDK includes callbacks on
and mutual authentication and authorization scaffolding.

<!-- TOC -->

* [Dataplane SDK .NET](#dataplane-sdk-net)
* [1. Installation and requirements](#1-installation-and-requirements)
* [2. Usage (with API)](#2-usage-with-api)
* [2.1 Configuring the SDK](#21-configuring-the-sdk)
* [2.2 Configuring SDK services](#22-configuring-sdk-services)
* [2.3 Setting up authentication for incoming requests](#23-setting-up-authentication-for-incoming-requests)
* [2.4 Setting up authorization of incoming HTTP requests](#24-setting-up-authorization-of-incoming-http-requests)
* [2.5 Setting up authorization of outgoing HTTP requests](#25-setting-up-authorization-of-outgoing-http-requests)
* [Named vs unnamed `HttpClient`](#named-vs-unnamed-httpclient)
* [3. Usage (core only)](#3-usage-core-only)
* [4. Required configuration](#4-required-configuration)
* [5. DataPlane Signaling API callbacks](#5-dataplane-signaling-api-callbacks)
* [6. In-memory vs PostgreSQL persistence](#6-in-memory-vs-postgresql-persistence)
* [7. Using the Control API](#7-using-the-control-api)
* [8. Reporting issues and bugs](#8-reporting-issues-and-bugs)
* [1. Installation and requirements](#1-installation-and-requirements)
* [2. Usage (with API)](#2-usage-with-api)
* [2.1 Configuring the SDK](#21-configuring-the-sdk)
* [2.2 Configuring SDK services](#22-configuring-sdk-services)
* [2.3 Setting up authentication for incoming requests](#23-setting-up-authentication-for-incoming-requests)
* [2.4 Setting up authorization of incoming HTTP requests](#24-setting-up-authorization-of-incoming-http-requests)
* [2.5 Setting up authorization of outgoing HTTP requests](#25-setting-up-authorization-of-outgoing-http-requests)
* [Named vs unnamed `HttpClient`](#named-vs-unnamed-httpclient)
* [3. Usage (core only)](#3-usage-core-only)
* [4. Required configuration](#4-required-configuration)
* [5. DataPlane Signaling API callbacks](#5-dataplane-signaling-api-callbacks)
* [6. In-memory vs PostgreSQL persistence](#6-in-memory-vs-postgresql-persistence)
* [7. Using the Control API](#7-using-the-control-api)
* [8. Reporting issues and bugs](#8-reporting-issues-and-bugs)

<!-- TOC -->

## 1. Installation and requirements
Expand Down Expand Up @@ -219,7 +221,7 @@ In situations where the built-in API server for DataPlane Signaling cannot be us
`DataPlane.Sdk.Core` module. While this will forego all API controllers, authentication and authorization, it will still
provide
core services and persistence. To do that, add the `DataPlane.Sdk.Core` package to your .NET project:
`dotnet add package DataPlane.Sdk.Core --version 0.0.1-alpha`.
`dotnet add package DataPlane.Sdk.Core --version <VERSION>`.

Depending on the type of project (console, webapi) an `IHost` may or may not be available. If it is, client code can
still utilize the dependency injection facilities built into the SDK by calling the `AddSdkServices(sdk)` extension
Expand Down
Loading