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
42 changes: 30 additions & 12 deletions .github/workflows/manylinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,7 @@ jobs:
id: opencv-cache
uses: actions/cache/restore@v5
with:
path: |
${{ github.workspace }}/opencv_artifacts/include
${{ github.workspace }}/opencv_artifacts/lib64
path: ${{ github.workspace }}/opencv_artifacts
key: opencv-${{ env.OPENCV_VERSION }}-manylinux2_28-full-${{ hashFiles('vcpkg.json', 'cmake/opencv_build_options.cmake', 'docker/manylinux/build_static_deps.sh') }}

- name: Configure OpenCV (full)
Expand Down Expand Up @@ -150,14 +148,25 @@ jobs:
run: |
cmake --build opencv/build -j 3
cmake --install opencv/build
echo "=== opencv_artifacts layout ==="
find ${GITHUB_WORKSPACE}/opencv_artifacts -name 'OpenCVConfig.cmake' -o -name '*.pc' | head -20
du -sh ${GITHUB_WORKSPACE}/opencv_artifacts/*/

- name: Validate OpenCV install (full)
if: steps.opencv-cache.outputs.cache-hit != 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
config=$(find ${GITHUB_WORKSPACE}/opencv_artifacts -name 'OpenCVConfig.cmake' | head -1)
if [ -z "$config" ]; then
echo "ERROR: OpenCVConfig.cmake not found under opencv_artifacts - install is incomplete."
exit 1
fi
echo "Found: $config"
shell: bash
- name: Save OpenCV cache (full)
if: steps.opencv-cache.outputs.cache-hit != 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: actions/cache/save@v5
with:
path: |
${{ github.workspace }}/opencv_artifacts/include
${{ github.workspace }}/opencv_artifacts/lib64
path: ${{ github.workspace }}/opencv_artifacts
key: opencv-${{ env.OPENCV_VERSION }}-manylinux2_28-full-${{ hashFiles('vcpkg.json', 'cmake/opencv_build_options.cmake', 'docker/manylinux/build_static_deps.sh') }}

# -- OpenCvSharpExtern ---------------------------------------------------
Expand Down Expand Up @@ -208,9 +217,7 @@ jobs:
id: opencv-cache
uses: actions/cache/restore@v5
with:
path: |
${{ github.workspace }}/opencv_artifacts_slim/include
${{ github.workspace }}/opencv_artifacts_slim/lib64
path: ${{ github.workspace }}/opencv_artifacts_slim
key: opencv-${{ env.OPENCV_VERSION }}-manylinux2_28-slim-${{ hashFiles('cmake/opencv_build_options_slim.cmake') }}

- name: Configure OpenCV (slim)
Expand All @@ -231,14 +238,25 @@ jobs:
run: |
cmake --build opencv/build -j 3
cmake --install opencv/build
echo "=== opencv_artifacts_slim layout ==="
find ${GITHUB_WORKSPACE}/opencv_artifacts_slim -name 'OpenCVConfig.cmake' -o -name '*.pc' | head -20
du -sh ${GITHUB_WORKSPACE}/opencv_artifacts_slim/*/

- name: Save OpenCV cache (slim)
if: steps.opencv-cache.outputs.cache-hit != 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
config=$(find ${GITHUB_WORKSPACE}/opencv_artifacts_slim -name 'OpenCVConfig.cmake' | head -1)
if [ -z "$config" ]; then
echo "ERROR: OpenCVConfig.cmake not found under opencv_artifacts_slim - install is incomplete."
exit 1
fi
echo "Found: $config"
shell: bash
- name: Save OpenCV cache (slim) - upload
if: steps.opencv-cache.outputs.cache-hit != 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: actions/cache/save@v5
with:
path: |
${{ github.workspace }}/opencv_artifacts_slim/include
${{ github.workspace }}/opencv_artifacts_slim/lib64
path: ${{ github.workspace }}/opencv_artifacts_slim
key: opencv-${{ env.OPENCV_VERSION }}-manylinux2_28-slim-${{ hashFiles('cmake/opencv_build_options_slim.cmake') }}

- name: Build OpenCvSharpExtern (slim)
Expand Down
82 changes: 48 additions & 34 deletions .github/workflows/publish_nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,38 +18,6 @@ jobs:
name: packages_windows
branch: ${{ github.ref_name }}

- name: Download ubuntu 22 artifact
uses: dawidd6/action-download-artifact@v14
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: ubuntu.yml
name: artifacts_ubuntu_22.04
branch: ${{ github.ref_name }}

- name: Download ubuntu 24 artifact
uses: dawidd6/action-download-artifact@v14
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: ubuntu.yml
name: artifacts_ubuntu_24.04
branch: ${{ github.ref_name }}

- name: Download ubuntu 22 slim artifact
uses: dawidd6/action-download-artifact@v14
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: ubuntu-slim.yml
name: artifacts_ubuntu_slim_22.04
branch: ${{ github.ref_name }}

- name: Download ubuntu 24 slim artifact
uses: dawidd6/action-download-artifact@v14
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: ubuntu-slim.yml
name: artifacts_ubuntu_slim_24.04
branch: ${{ github.ref_name }}

- name: Download ubuntu arm artifact
uses: dawidd6/action-download-artifact@v14
with:
Expand All @@ -74,6 +42,14 @@ jobs:
name: artifacts_wasm
branch: ${{ github.ref_name }}

- name: Download manylinux artifact
uses: dawidd6/action-download-artifact@v14
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: manylinux.yml
name: nuget-packages-manylinux
branch: ${{ github.ref_name }}

- run: |
ls -l

Expand Down Expand Up @@ -154,5 +130,43 @@ jobs:

- name: Push to nuget.org
run: |
dotnet nuget push "*.nupkg" -k ${{secrets.NUGET_ORG_API_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate
dotnet nuget push "*.snupkg" -k ${{secrets.NUGET_ORG_API_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate
set -euo pipefail

pushed=0
failed=0

push_package() {
local file="$1"
local name
name=$(basename "$file")
local output
if output=$(dotnet nuget push "$file" \
-k ${{secrets.NUGET_ORG_API_KEY}} \
-s https://api.nuget.org/v3/index.json 2>&1); then
echo "PUSHED: $name"
echo "| \`$name\` | ✅ Pushed |" >> $GITHUB_STEP_SUMMARY
pushed=$((pushed + 1))
else
echo "FAILED: $name"
echo "$output"
echo "| \`$name\` | ❌ Failed |" >> $GITHUB_STEP_SUMMARY
failed=$((failed + 1))
fi
}

echo "## Push Results" >> $GITHUB_STEP_SUMMARY
echo "| Package | Status |" >> $GITHUB_STEP_SUMMARY
echo "|---------|--------|" >> $GITHUB_STEP_SUMMARY

for f in *.nupkg *.snupkg; do
[ -f "$f" ] || continue
push_package "$f"
done

echo "" >> $GITHUB_STEP_SUMMARY
echo "**Pushed:** $pushed **Failed:** $failed" >> $GITHUB_STEP_SUMMARY

if [ "$failed" -gt 0 ]; then
echo "ERROR: $failed package(s) failed to push."
exit 1
fi
8 changes: 4 additions & 4 deletions docs/docfx/articles/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ Install OpenCvSharp via NuGet Package Manager:
dotnet add package OpenCvSharp4

# Native bindings (choose one based on your platform)
dotnet add package OpenCvSharp4.runtime.win # Windows
+# dotnet add package OpenCvSharp4.runtime.win.slim # Windows slim
dotnet add package OpenCvSharp4.official.runtime.ubuntu.24.04-x64 # Ubuntu 24.04
# dotnet add package OpenCvSharp4.official.runtime.ubuntu.24.04-x64.slim # Ubuntu 24.04 slim
dotnet add package OpenCvSharp4.runtime.win # Windows
# dotnet add package OpenCvSharp4.runtime.win.slim # Windows slim
dotnet add package OpenCvSharp4.official.runtime.linux-x64 # Linux x64
# dotnet add package OpenCvSharp4.official.runtime.linux-x64.slim # Linux x64 slim
```

### Quick Example
Expand Down
29 changes: 0 additions & 29 deletions nuget/OpenCvSharp4.official.runtime.ubuntu.22.04-x64.csproj

This file was deleted.

28 changes: 0 additions & 28 deletions nuget/OpenCvSharp4.official.runtime.ubuntu.22.04-x64.slim.csproj

This file was deleted.

29 changes: 0 additions & 29 deletions nuget/OpenCvSharp4.official.runtime.ubuntu.24.04-x64.csproj

This file was deleted.

28 changes: 0 additions & 28 deletions nuget/OpenCvSharp4.official.runtime.ubuntu.24.04-x64.slim.csproj

This file was deleted.

Loading