Skip to content

Commit 1a701b4

Browse files
author
Aliaksandr Adziareika
committed
Fix C# bindings on linux
1 parent 75ccf28 commit 1a701b4

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

.github/actions/package-bindings-csharp/action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,11 @@ runs:
5151
echo "short-sha-dotnet=$short_sha" >> $GITHUB_OUTPUT
5252
fi
5353
54+
# Read generator from CMakeCache to ensure proper reconfiguration (especially for Ninja)
55+
CMAKE_GENERATOR=$(grep "^CMAKE_GENERATOR:" "$CMAKE_BUILD_PATH/CMakeCache.txt" | cut -d'=' -f2)
56+
5457
echo "::group::CMake Configure (enable C# bindings)"
55-
cmake -B "$CMAKE_BUILD_PATH" -DOPENDAQ_GENERATE_CSHARP_BINDINGS=ON
58+
cmake -B "$CMAKE_BUILD_PATH" -G "$CMAKE_GENERATOR" -DOPENDAQ_GENERATE_CSHARP_BINDINGS=ON
5659
echo "::endgroup::"
5760
5861
echo "::group::CMake Build DotNetBindings"

.github/actions/package-bindings-python/action.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ runs:
5757
env:
5858
CMAKE_BUILD_TYPE: ${{ inputs.cmake-build-type }}
5959
CMAKE_BUILD_PATH: ${{ inputs.build-path }}
60-
PYTHON_VERSION_FROM_SETUP: ${{ steps.python-setup.outputs.python-version }}
61-
SKIP_SETUP_PYTHON: ${{ inputs.skip-setup-python }}
60+
PYTHON_VERSION_LATEST: ${{ steps.python-setup.outputs.python-version }}
6261
run: |
6362
if command -v cygpath &> /dev/null; then
6463
CMAKE_BUILD_PATH=$(cygpath -u "$CMAKE_BUILD_PATH")
@@ -99,17 +98,17 @@ runs:
9998
fi
10099
101100
# Determine the latest Python version for build_pip.py
102-
if [ "$SKIP_SETUP_PYTHON" == "true" ]; then
101+
if [ -z "$PYTHON_VERSION_LATEST" ]; then
103102
# When setup-python is skipped, get latest version from sorted list
104103
PYTHON_VERSION_LATEST=$(echo "$PYTHON_VERSIONS" | tail -n1)
105104
else
106-
PYTHON_VERSION_LATEST=$(echo "$PYTHON_VERSION_FROM_SETUP" | cut -d. -f1,2)
105+
PYTHON_VERSION_LATEST=$(echo "$PYTHON_VERSION_LATEST" | cut -d. -f1,2)
107106
fi
108107
echo "Using Python $PYTHON_VERSION_LATEST for build_pip.py"
109108
110109
while IFS= read -r version; do
111110
echo "::group::CMake Configure (Python $version)"
112-
cmake -B "$CMAKE_BUILD_PATH" \
111+
cmake -B "$CMAKE_BUILD_PATH" -G "$CMAKE_GENERATOR" \
113112
-DOPENDAQ_GENERATE_PYTHON_BINDINGS=ON \
114113
-DOPENDAQ_PYTHON_VERSION="$version" \
115114
-DPYBIND11_FINDPYTHON=ON

.github/workflows/package-sandbox.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -348,16 +348,15 @@ jobs:
348348
path: ${{ steps.build-sdk.outputs.build-path }}/bin/application_simulator
349349
retention-days: 7
350350

351-
- name: Upload binaries for .NET NuGet
351+
- name: Build C# Bindings
352+
id: package-csharp-bindings
352353
if: matrix.generate-csharp-bindings == true
353-
uses: actions/upload-artifact@v4
354+
uses: ./.github/actions/package-bindings-csharp
354355
with:
355-
name: SdkLinux64
356-
path: |
357-
${{ steps.build-sdk.outputs.build-path }}/bin/*.so
358-
!${{ steps.build-sdk.outputs.build-path }}/**/opendaq.cpython*
359-
!${{ steps.build-sdk.outputs.build-path }}/**/*_test_dll.so
360-
retention-days: 1
356+
build-path: ${{ steps.build-sdk.outputs.build-path }}
357+
cmake-build-type: ${{ matrix.cmake-build-type }}
358+
package-artifact-name: ${{ env.linux_x64_artifact }}
359+
package-artifact-retention-days: 1
361360

362361
build_macos:
363362
name: ${{ matrix.name }}

0 commit comments

Comments
 (0)