Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Added Linux keys, updated build path based on MacOS run #13

Added Linux keys, updated build path based on MacOS run

Added Linux keys, updated build path based on MacOS run #13

# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform.
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml
name: CMake on multiple platforms
on:
push:
tags:
- '*'
permissions:
contents: write
jobs:
build:
name: Release pushed tag
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
# os: [ubuntu-latest, windows-latest, macos-latest]
# build_type: [Release]
# c_compiler: [gcc, clang, cl]
config:
- {
name: "Ubuntu Latest",
os: ubuntu-latest,
cc: "clang",
cxx: "clang++",
generators: "Ninja"
}
- {
name: "MacOS Latest",
os: macos-latest,
cc: "clang",
cxx: "clang++",
uses: maxim-lobanov/setup-xcode@v1
}
steps:
- uses: actions/checkout@v4
- name: Install OpenCV
env:
OPENCV_VERSION: '4.9.0'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run:
if [[ "$(uname)" == *"Darwin"* ]]; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)";
eval "$(/opt/homebrew/bin/brew shellenv)";
brew install opencv;
fi;
if [[ "$(uname)" == "Linux" ]]; then
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 605C66F00D6C9793 0E98404D386FA1D9 648ACFD622F3D138;
sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main";
sudo apt update;
sudo apt remove x264 libx264-dev -y;
sudo apt install build-essential checkinstall cmake pkg-config yasm -y;
udo apt install git gfortran libjpeg8-dev libjasper1 libjasper-dev libpng-dev -y;
sudo apt install libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev -y;
sudo apt install libxine2-dev libv4l-dev -y;
sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev -y;
sudo apt install libatlas-base-dev -y;
sudo apt install libfaac-dev libmp3lame-dev libtheora-dev -y;
sudo apt install libvorbis-dev libxvidcore-dev -y;
sudo apt install libopencore-amrnb-dev libopencore-amrwb-dev -y;
sudo apt install x264 v4l-utils clang g++ unzip -y;
sudo apt install opencv -y;
fi;
- name: Build Project
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run:
mkdir build;
cmake CMakeLists.txt -S src -B build;
mv build/FaceDetection build/FaceDetection-"$(uname)"
- name: Publish Release to Tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
RUNNER_OS: ${{ github.runner_os }}
run:
echo "Configuring for $(RUNNER_OS) [$(uname)].";
if [[ "$(gh release view $tag 2>&1)" == "release not found" ]]; then
echo "Release not found. Creating release.";
gh release create "$tag" --repo="$GITHUB_REPOSITORY" --title="$(tag#v)" --generate-notes build/FaceDetection-"$(uname)";
else
echo "Release found. Appending files to release.";
gh release upload "$tag" build/FaceDetection-"$(uname)";
fi;