Update github ci for artifact #12
This file contains 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: 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 | |
run: cmake -S . -B build -DBUILD_EXAMPLE:BOOL="1" -DBUILD_EXAMPLE_OPENCV:BOOL="1" -DBUILD_BENCHMARK:BOOL="1" -DUSE_OPENMP:BOOL="1" | |
- name: Build | |
run: cmake --build build --config Release | |
- name: List build folder | |
run: ls ./build/ | |
- name: Archive Linux build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: linux-artifacts | |
path: | | |
./build/example | |
./build/benchmark | |
./build/example-opencv | |
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 | |
- name: Install dependencies | |
run: | | |
choco install cmake --version=3.31.3 | |
choco install opencv --version=4.10.0 | |
- name: CMake Configure & Generate | |
run: cmake -S . -B build -DBUILD_EXAMPLE:BOOL="1" -DBUILD_EXAMPLE_OPENCV:BOOL="1" -DBUILD_BENCHMARK:BOOL="1" -DUSE_OPENMP:BOOL="1" -DOpenCV_DIR:PATH="C:\tools\opencv\build" | |
- name: Build | |
run: cmake --build build --config Release | |
- name: List build folder | |
run: | | |
dir .\build\ | |
dir .\build\Release\ | |
- name: Archive Windows build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: windows-artifacts | |
path: | | |
.\build\Release\example.exe | |
.\build\Release\benchmark.exe | |
.\build\Release\example-opencv.exe | |
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/* | |