Skip to content

Add linux-x86/windows-x86 github ci #14

Add linux-x86/windows-x86 github ci

Add linux-x86/windows-x86 github ci #14

Workflow file for this run

name: Release CI
on:
push:
tags:
- "v*.*.*"
branches:
- main
- test-ci
permissions:
contents: write
discussions: write
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake
sudo apt-get install -y libomp-dev
sudo apt-get install -y libopencv-dev
- name: CMake Configure & Generate(x86)
run: cmake -S . -B build-x86- -DBUILD_EXAMPLE:BOOL="1" -DBUILD_EXAMPLE_OPENCV:BOOL="1" -DBUILD_BENCHMARK:BOOL="1" -DUSE_OPENMP:BOOL="1" -DCMAKE_GENERATOR_PLATFORM=x86
- name: Build(x86)
run: cmake --build build-x86 --config Release
- name: CMake Configure & Generate(x64)
run: cmake -S . -B build-x64 -DBUILD_EXAMPLE:BOOL="1" -DBUILD_EXAMPLE_OPENCV:BOOL="1" -DBUILD_BENCHMARK:BOOL="1" -DUSE_OPENMP:BOOL="1" -DCMAKE_GENERATOR_PLATFORM=x64
- name: Build(x64)
run: cmake --build build-x64 --config Release
- name: List build folder
run: |
ls ./build-x86/
ls ./build-x64/
- name: Zip binary files
run: |
zip ./bin-linux-gcc-x86.zip ./build-x86/example ./build-x86/benchmark ./build-x86/example-opencv
zip ./bin-linux-gcc-x64.zip ./build-x64/example ./build-x64/benchmark ./build-x64/example-opencv
- name: Archive Linux build artifacts
uses: actions/upload-artifact@v4
with:
name: linux-artifacts
path: |
./bin-linux-gcc-x86.zip
./bin-linux-gcc-x64.zip
build-windows:
runs-on: windows-latest
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Setup MSVC Developer Command Prompt
uses: TheMrMilchmann/[email protected]
with:
arch: |
x64
amd64_x86
amd64_arm
amd64_arm64
- name: Install dependencies
run: |
choco install cmake --version=3.31.3
choco install opencv --version=4.10.0
choco install zip --version=3.0
- name: CMake Configure & Generate(x86)
run: cmake -S . -B build-x86 -DBUILD_EXAMPLE:BOOL="1" -DBUILD_EXAMPLE_OPENCV:BOOL="1" -DBUILD_BENCHMARK:BOOL="1" -DUSE_OPENMP:BOOL="1" -DOpenCV_DIR:PATH="C:\tools\opencv\build-x86" -A Win32
- name: Build(x86)
run: cmake --build build-x86 --config Release
- name: CMake Configure & Generate(x64)
run: cmake -S . -B build-x64 -DBUILD_EXAMPLE:BOOL="1" -DBUILD_EXAMPLE_OPENCV:BOOL="1" -DBUILD_BENCHMARK:BOOL="1" -DUSE_OPENMP:BOOL="1" -DOpenCV_DIR:PATH="C:\tools\opencv\build-x64" -A x64
- name: Build(x64)
run: cmake --build build-x64 --config Release
- name: List build folder
run: |
dir .\build-x86\
dir .\build-x86\Release\
dir .\build-x64\
dir .\build-x64\Release\
- name: Zip binary files
run: |
zip ./bin-windows-msvc-x86.zip .\build-x86\Release\example.exe .\build-x86\Release\benchmark.exe .\build-x86\Release\example-opencv.exe
zip ./bin-windows-msvc-x64.zip .\build-x64\Release\example.exe .\build-x64\Release\benchmark.exe .\build-x64\Release\example-opencv.exe
- name: Archive Windows build artifacts
uses: actions/upload-artifact@v4
with:
name: windows-artifacts
path: |
./bin-windows-msvc-x86.zip
./bin-windows-msvc-x64.zip
release:
needs: [build-linux, build-windows]
runs-on: ubuntu-latest
steps:
- name: Download Linux/Windows artifacts
uses: actions/download-artifact@v4
with:
path: ./releasefiles
merge-multiple: true
- name: Display structure of downloaded files
run: ls -R ./releasefiles
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: |
./releasefiles/*