mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-13 01:58:30 +00:00
commit
1b9531a86f
23
.github/workflows/ci.yml
vendored
23
.github/workflows/ci.yml
vendored
@ -1,12 +1,15 @@
|
|||||||
name: RGB.NET-CI
|
name: RGB.NET-CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
workflow_dispatch:
|
||||||
branches: [ Development ]
|
inputs:
|
||||||
paths:
|
version:
|
||||||
- '**.cs'
|
description: 'version'
|
||||||
- '**.csproj'
|
required: true
|
||||||
- '**.yml'
|
type: string
|
||||||
|
increment:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@ -24,16 +27,10 @@ jobs:
|
|||||||
8.0.x
|
8.0.x
|
||||||
7.0.x
|
7.0.x
|
||||||
6.0.x
|
6.0.x
|
||||||
- name: Git Semantic Version
|
|
||||||
id: versioning
|
|
||||||
uses: PaulHatch/semantic-version@v4.0.3
|
|
||||||
with:
|
|
||||||
short_tags: false
|
|
||||||
format: "${major}.${minor}.${patch}-prerelease.${increment}"
|
|
||||||
- name: Restore dependencies
|
- name: Restore dependencies
|
||||||
run: dotnet restore
|
run: dotnet restore
|
||||||
- name: Build
|
- name: Build
|
||||||
run: dotnet build --no-restore --configuration Release /p:Version=${{ steps.versioning.outputs.version }}
|
run: dotnet build --no-restore --configuration Release /p:Version=${{ github.event.inputs.version }}-prerelease.${{ github.event.inputs.increment }}
|
||||||
- name: Test
|
- name: Test
|
||||||
run: dotnet test --no-build --verbosity normal --configuration Release
|
run: dotnet test --no-build --verbosity normal --configuration Release
|
||||||
- name: Upload a Build Artifact NET6
|
- name: Upload a Build Artifact NET6
|
||||||
|
|||||||
22
.github/workflows/release.yml
vendored
22
.github/workflows/release.yml
vendored
@ -1,12 +1,12 @@
|
|||||||
name: RGB.NET-Release
|
name: RGB.NET-Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
workflow_dispatch:
|
||||||
branches: [ master ]
|
inputs:
|
||||||
paths:
|
version:
|
||||||
- '**.cs'
|
description: 'version'
|
||||||
- '**.csproj'
|
required: true
|
||||||
- '**.yml'
|
type: string
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@ -23,16 +23,10 @@ jobs:
|
|||||||
8.0.x
|
8.0.x
|
||||||
7.0.x
|
7.0.x
|
||||||
6.0.x
|
6.0.x
|
||||||
- name: Git Semantic Version
|
|
||||||
id: versioning
|
|
||||||
uses: PaulHatch/semantic-version@v4.0.3
|
|
||||||
with:
|
|
||||||
short_tags: false
|
|
||||||
format: "${major}.${minor}.${patch}"
|
|
||||||
- name: Restore dependencies
|
- name: Restore dependencies
|
||||||
run: dotnet restore
|
run: dotnet restore
|
||||||
- name: Build
|
- name: Build
|
||||||
run: dotnet build --no-restore --configuration Release /p:Version=${{ steps.versioning.outputs.version }}
|
run: dotnet build --no-restore --configuration Release /p:Version=${{ github.event.inputs.version }}
|
||||||
- name: Test
|
- name: Test
|
||||||
run: dotnet test --no-build --verbosity normal --configuration Release
|
run: dotnet test --no-build --verbosity normal --configuration Release
|
||||||
- name: Upload a Build Artifact NET6
|
- name: Upload a Build Artifact NET6
|
||||||
@ -62,7 +56,7 @@ jobs:
|
|||||||
- name: Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ steps.versioning.outputs.version_tag }}
|
tag_name: v${{ github.event.inputs.version }}
|
||||||
generate_release_notes: true
|
generate_release_notes: true
|
||||||
files: bin/net8.0/RGB.NET.*.dll
|
files: bin/net8.0/RGB.NET.*.dll
|
||||||
- name: Nuget Push
|
- name: Nuget Push
|
||||||
|
|||||||
@ -47,6 +47,9 @@ internal static unsafe class _CUESDK
|
|||||||
|
|
||||||
#region Properties & Fields
|
#region Properties & Fields
|
||||||
|
|
||||||
|
// ReSharper disable once NotAccessedField.Local - This is important, the delegate can be collected if it's not stored!
|
||||||
|
private static readonly CorsairSessionStateChangedHandler SESSION_STATE_CHANGED_CALLBACK;
|
||||||
|
|
||||||
internal static bool IsConnected => SesionState == CorsairSessionState.Connected;
|
internal static bool IsConnected => SesionState == CorsairSessionState.Connected;
|
||||||
internal static CorsairSessionState SesionState { get; private set; }
|
internal static CorsairSessionState SesionState { get; private set; }
|
||||||
|
|
||||||
@ -58,6 +61,15 @@ internal static unsafe class _CUESDK
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Constructors
|
||||||
|
|
||||||
|
static _CUESDK()
|
||||||
|
{
|
||||||
|
SESSION_STATE_CHANGED_CALLBACK = CorsairSessionStateChangedCallback;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region Methods
|
#region Methods
|
||||||
|
|
||||||
private static void CorsairSessionStateChangedCallback(nint context, _CorsairSessionStateChanged eventdata)
|
private static void CorsairSessionStateChangedCallback(nint context, _CorsairSessionStateChanged eventdata)
|
||||||
@ -174,7 +186,7 @@ internal static unsafe class _CUESDK
|
|||||||
{
|
{
|
||||||
if (_corsairConnectPtr == null) throw new RGBDeviceException("The Corsair-SDK is not initialized.");
|
if (_corsairConnectPtr == null) throw new RGBDeviceException("The Corsair-SDK is not initialized.");
|
||||||
if (IsConnected) throw new RGBDeviceException("The Corsair-SDK is already connected.");
|
if (IsConnected) throw new RGBDeviceException("The Corsair-SDK is already connected.");
|
||||||
return _corsairConnectPtr(CorsairSessionStateChangedCallback, 0);
|
return _corsairConnectPtr(SESSION_STATE_CHANGED_CALLBACK, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static CorsairError CorsairGetSessionDetails(out _CorsairSessionDetails? details)
|
internal static CorsairError CorsairGetSessionDetails(out _CorsairSessionDetails? details)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user