Skip to content

Commit 1b9531a

Browse files
authored
Merge pull request #384 from DarthAffe/Development
Updated workflows
2 parents c0adbad + 5f71ffd commit 1b9531a

3 files changed

Lines changed: 31 additions & 28 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
name: RGB.NET-CI
22

33
on:
4-
push:
5-
branches: [ Development ]
6-
paths:
7-
- '**.cs'
8-
- '**.csproj'
9-
- '**.yml'
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'version'
8+
required: true
9+
type: string
10+
increment:
11+
required: true
12+
type: string
1013

1114
jobs:
1215
build:
@@ -24,16 +27,10 @@ jobs:
2427
8.0.x
2528
7.0.x
2629
6.0.x
27-
- name: Git Semantic Version
28-
id: versioning
29-
uses: PaulHatch/semantic-version@v4.0.3
30-
with:
31-
short_tags: false
32-
format: "${major}.${minor}.${patch}-prerelease.${increment}"
3330
- name: Restore dependencies
3431
run: dotnet restore
3532
- name: Build
36-
run: dotnet build --no-restore --configuration Release /p:Version=${{ steps.versioning.outputs.version }}
33+
run: dotnet build --no-restore --configuration Release /p:Version=${{ github.event.inputs.version }}-prerelease.${{ github.event.inputs.increment }}
3734
- name: Test
3835
run: dotnet test --no-build --verbosity normal --configuration Release
3936
- name: Upload a Build Artifact NET6

.github/workflows/release.yml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
name: RGB.NET-Release
22

33
on:
4-
push:
5-
branches: [ master ]
6-
paths:
7-
- '**.cs'
8-
- '**.csproj'
9-
- '**.yml'
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'version'
8+
required: true
9+
type: string
1010

1111
jobs:
1212
build:
@@ -23,16 +23,10 @@ jobs:
2323
8.0.x
2424
7.0.x
2525
6.0.x
26-
- name: Git Semantic Version
27-
id: versioning
28-
uses: PaulHatch/semantic-version@v4.0.3
29-
with:
30-
short_tags: false
31-
format: "${major}.${minor}.${patch}"
3226
- name: Restore dependencies
3327
run: dotnet restore
3428
- name: Build
35-
run: dotnet build --no-restore --configuration Release /p:Version=${{ steps.versioning.outputs.version }}
29+
run: dotnet build --no-restore --configuration Release /p:Version=${{ github.event.inputs.version }}
3630
- name: Test
3731
run: dotnet test --no-build --verbosity normal --configuration Release
3832
- name: Upload a Build Artifact NET6
@@ -62,7 +56,7 @@ jobs:
6256
- name: Release
6357
uses: softprops/action-gh-release@v1
6458
with:
65-
tag_name: ${{ steps.versioning.outputs.version_tag }}
59+
tag_name: v${{ github.event.inputs.version }}
6660
generate_release_notes: true
6761
files: bin/net8.0/RGB.NET.*.dll
6862
- name: Nuget Push

RGB.NET.Devices.Corsair/Native/_CUESDK.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ internal static unsafe class _CUESDK
4747

4848
#region Properties & Fields
4949

50+
// ReSharper disable once NotAccessedField.Local - This is important, the delegate can be collected if it's not stored!
51+
private static readonly CorsairSessionStateChangedHandler SESSION_STATE_CHANGED_CALLBACK;
52+
5053
internal static bool IsConnected => SesionState == CorsairSessionState.Connected;
5154
internal static CorsairSessionState SesionState { get; private set; }
5255

@@ -58,6 +61,15 @@ internal static unsafe class _CUESDK
5861

5962
#endregion
6063

64+
#region Constructors
65+
66+
static _CUESDK()
67+
{
68+
SESSION_STATE_CHANGED_CALLBACK = CorsairSessionStateChangedCallback;
69+
}
70+
71+
#endregion
72+
6173
#region Methods
6274

6375
private static void CorsairSessionStateChangedCallback(nint context, _CorsairSessionStateChanged eventdata)
@@ -174,7 +186,7 @@ internal static CorsairError CorsairConnect()
174186
{
175187
if (_corsairConnectPtr == null) throw new RGBDeviceException("The Corsair-SDK is not initialized.");
176188
if (IsConnected) throw new RGBDeviceException("The Corsair-SDK is already connected.");
177-
return _corsairConnectPtr(CorsairSessionStateChangedCallback, 0);
189+
return _corsairConnectPtr(SESSION_STATE_CHANGED_CALLBACK, 0);
178190
}
179191

180192
internal static CorsairError CorsairGetSessionDetails(out _CorsairSessionDetails? details)

0 commit comments

Comments
 (0)