Skip to content

Build App

Build App #66

Workflow file for this run

name: Build App
on: [workflow_dispatch]
env:
BUILD_TYPE: Release
OPENCV_VERSION: 4.2.0
LEPTONICA_VERSION: 1.74.3
TESSERACT_VERSION: 3.05.02
TESSERACT_LANGUAGE: eng
REPO_NAME: ${{ github.event.repository.name }}
LEPTONICA_BUILD: ${{github.workspace}}/leptonica/build
TESSERACT_BUILD: ${{github.workspace}}/tesseract/build
OPENCV_BUILD: ${{github.workspace}}/opencv/build
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
repository: DanBloomberg/leptonica
ref: ${{env.LEPTONICA_VERSION}}
path: leptonica
- uses: actions/checkout@v3
with:
repository: tesseract-ocr/tesseract
ref: ${{env.TESSERACT_VERSION}}
path: tesseract
- uses: actions/checkout@v3
with:
repository: opencv/opencv
ref: ${{env.OPENCV_VERSION}}
path: opencv
- uses: actions/checkout@v3
with:
path: ${{env.REPO_NAME}}
- uses: ilammy/msvc-dev-cmd@v1
- name: Build Leptonica ${{env.LEPTONICA_VERSION}}
run: |
cd ${{github.workspace}}/leptonica
cmake -B ${{env.LEPTONICA_BUILD}} -G "NMake Makefiles" `
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} `
-DCMAKE_INSTALL_PREFIX=${{env.LEPTONICA_BUILD}} `
-DCMAKE_DISABLE_FIND_PACKAGE_PkgConfig=ON `
-DCMAKE_CXX_FLAGS=/DNO_CONSOLE_IO=1 `
-DCMAKE_CXX_FLAGS_RELEASE=/DMT `
-DCMAKE_CXX_FLAGS_DEBUG=/DMTd `
-DSTATIC=1
cmake --build ${{env.LEPTONICA_BUILD}} --config ${{env.BUILD_TYPE}} --target install
- name: Build Tesseract-OCR ${{env.TESSERACT_VERSION}}
run: |
cd ${{github.workspace}}/tesseract
cmake -B ${{env.TESSERACT_BUILD}} -G "NMake Makefiles" `
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} `
-DCMAKE_PREFIX_PATH=${{env.LEPTONICA_BUILD}} `
-DCMAKE_INSTALL_PREFIX=${{env.TESSERACT_BUILD}} `
-DBUILD_TRAINING_TOOLS=OFF `
-DCMAKE_CXX_FLAGS_RELEASE=/DMT `
-DCMAKE_CXX_FLAGS_DEBUG=/DMTd `
-DSTATIC=1
cmake --build ${{env.TESSERACT_BUILD}} --config ${{env.BUILD_TYPE}} --target install
- name: Build OpenCV ${{env.OPENCV_VERSION}}
run: |
cd ${{github.workspace}}/opencv
cmake -B ${{env.OPENCV_BUILD}} -G "NMake Makefiles" `
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} `
-DCMAKE_INSTALL_PREFIX=${{env.OPENCV_BUILD}} `
-DBUILD_LIST="core,photo" `
-DWITH_FFMPEG=OFF `
-DWITH_OPENEXR=OFF `
-DBUILD_opencv_imgcodecs=OFF `
-DBUILD_opencv_apps=OFF `
-DBUILD_SHARED_LIBS=OFF `
-DWITH_PROTOBUF=OFF `
-DWITH_LAPACK=OFF `
-DSTATIC=1
cmake --build ${{env.OPENCV_BUILD}} --config ${{env.BUILD_TYPE}} --target install
- name: Build ${{env.REPO_NAME}}
run: |
cd ${{github.workspace}}/${{env.REPO_NAME}}
cmake -B ${{github.workspace}}/${{env.REPO_NAME}}/build -G "NMake Makefiles" `
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} `
-DCMAKE_PREFIX_PATH="${{env.LEPTONICA_BUILD}};${{env.TESSERACT_BUILD}};${{env.OPENCV_BUILD}}" `
-DTESSERACT_LANGUAGE=${{env.TESSERACT_LANGUAGE}}
cmake --build ${{github.workspace}}/${{env.REPO_NAME}}/build --config ${{env.BUILD_TYPE}}
- uses: actions/upload-artifact@master
if: always()
with:
name: ${{env.REPO_NAME}}-${{github.ref_name}}-build
path: ${{github.workspace}}/${{env.REPO_NAME}}/build/bin