Update linux-arm.yml #470
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Linux ARM (Docker) | |
on: | |
pull_request: | |
types: [synchronize, opened] | |
push: | |
branches: | |
- main | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
OPENCV_VERSION: 4.12.0 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/setup-qemu-action@v3 | |
- uses: docker/setup-buildx-action@v3 | |
with: | |
install: true | |
# Build with Buildx and cache Docker layers in GitHub Actions cache | |
- name: Build with Docker (cached) | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./docker/ubuntu24-dotnet8-opencv4.12.0 | |
platforms: linux/arm/v7 | |
build-args: | | |
OPENCV_VERSION=${{ env.OPENCV_VERSION }} | |
# Load the built image to local Docker for later docker create/cp | |
outputs: type=docker,name=opencvsharp-linux-arm:latest | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Extract build files from Docker instance | |
run: | | |
docker create -ti --name opencvsharp-linux-arm-tmp opencvsharp-linux-arm bash | |
docker cp opencvsharp-linux-arm-tmp:/artifacts . | |
- name: Patch nuspec with version and build NuGet package | |
run: | | |
sed -E --in-place=.bak "s/<version>[0-9]\.[0-9]{1,2}\.[0-9]{1,2}.[0-9]{8}(-beta[0-9]*)?<\/version>/<version>${OPENCV_VERSION}.$(date '+%Y%m%d')<\/version>/" nuget/OpenCvSharp4.runtime.linux-arm.nuspec | |
cp artifacts/libOpenCvSharpExtern.so nuget/ | |
dotnet pack nuget/OpenCvSharp4.runtime.linux-arm.csproj -o artifacts_arm | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: artifacts_linux_arm | |
path: artifacts_arm |