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
4 changes: 1 addition & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ on:
- reopened
- edited
- synchronize
push:
branches:
- master

jobs:
# Build source code
Expand All @@ -36,4 +33,5 @@ jobs:

# Build the project
- name: Build project
if: success()
run: dotnet cake build.cake --target=build
43 changes: 43 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Deploy
on:
pull_request:
types:
- closed

jobs:
# Deploy nuget package when a branch is labeled with `release` and the merge is done to master.
Deploy:
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release') && github.event.pull_request.base.ref == 'master'
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [8.0.x]
steps:
- name: Checkout Repository
uses: actions/checkout@v4

# Setup .NET SDK
- name: Set up .NET SDK ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ matrix.dotnet-version }}

# Setup cake tool
- name: Setup cake tool
run: dotnet tool install --global Cake.Tool

# Build the project
- name: Build project
if: success()
run: dotnet cake build.cake --target=build

# Deploy nuget package
- name: Deploy nuget package
if: success()
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: |
# Extract nuget package version
NUGET_PKG_VERSION=$(cat NETCore.Keycloak.Client/NETCore.Keycloak.Client.csproj | grep "PackageVersion" | awk -F '>' '{print $2}' | awk -F '<' '{print $1}')
dotnet nuget push NETCore.Keycloak.Client/Release/NETCore.Keycloak.Client.${NUGET_PKG_VERSION}.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json

12 changes: 11 additions & 1 deletion NETCore.Keycloak.Client/NETCore.Keycloak.Client.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Authors>Hasni Mehdi</Authors>
<Description>
A comprehensive .NET Core client library for Keycloak that provides seamless integration with Keycloak's authentication and authorization services.
This library offers a robust implementation of Keycloak's REST API, including support for OpenID Connect, OAuth 2.0, and User-Managed Access (UMA 2.0).
</Description>
<PackageVersion>1.0.0</PackageVersion>
<PackageId>NETCore.Keycloak.Client</PackageId>
<PackageTags>keycloak;oauth2;authentication;authorization;openid-connect;oidc;oidc-provider;fapi;fapi-client;user-managed-access;financial-security</PackageTags>
<PackageIcon>black_cockpit.png</PackageIcon>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable>
<OutputType>Library</OutputType>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<RootNamespace>NETCore.Keycloak.Client</RootNamespace>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
Expand All @@ -23,5 +32,6 @@
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.3.0"/>
<PackageReference Include="System.Text.Json" Version="8.0.5"/>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.33"/>
<None Include="black_cockpit.png" Pack="true" PackagePath="\"/>
</ItemGroup>
</Project>
Loading