Skip to content

📄 Awesome OCR multiple programing languages toolkits based on ONNX Runtime, OpenVINO, MNN, PaddlePaddle, TensorRT and PyTorch.

Create windows-all-build.yaml

Danielfba9c49b0e48
diff --git a/.github/workflows/windows-all-build.yaml b/.github/workflows/windows-all-build.yaml
new file mode 100644
index 0000000..0c39a1c
--- /dev/null
+++ b/.github/workflows/windows-all-build.yaml
@@ -0,0 +1,134 @@
+name: CMake-windows
+
+on:
+ push:
+ branches:
+ - 'main'
+ tags:
+ - "*"
+
+
+env:
+ # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
+ BUILD_TYPE: Release
+
+jobs:
+ build:
+ name: buildsrc
+ # The CMake configure and build commands are platform agnostic and should work equally
+ # well on Windows or Mac. You can convert this to a matrix build if you need
+ # cross-platform coverage.
+ # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
+ runs-on: windows-latest
+
+ steps:
+ - name: Install 7Zip PowerShell Module
+ shell: powershell
+ run: Install-Module 7Zip4PowerShell -Force -Verbose
+
+ - uses: actions/checkout@v2
+ - name: Create Build Environment
+ # Some projects don't allow in-source building, so create a separate build directory
+ # We'll use this as our working directory for all subsequent commands
+ run: cmake -E make_directory ${{github.workspace}}/build
+ - uses: suisei-cn/actions-download-file@v1
+ id: downloadfile1 # Remember to give an ID if you need the output filename
+ name: Download the file
+ with:
+ url: "https://github.com/microsoft/onnxruntime/releases/download/v1.7.0/onnxruntime-win-x64-1.7.0.zip"
+ target: public/
+ - uses: suisei-cn/actions-download-file@v1
+ id: downloadfile2 # Remember to give an ID if you need the output filename
+ name: Download the file
+ with:
+ url: "https://github.com/opencv/opencv/releases/download/4.5.1/opencv-4.5.1-vc14_vc15.exe"
+ target: public/
+ - name: setup working dir
+ run: |
+ mkdir c:\rapidocr
+ - name: Decompress
+ shell: powershell
+ run: |
+ Expand-7Zip -ArchiveFileName public/onnxruntime-win-x64-1.7.0.zip -TargetPath c:\rapidocr\
+
+
+ - name: opencv install
+ run: |
+ Expand-7Zip -ArchiveFileName public/opencv-4.5.1-vc14_vc15.exe -TargetPath c:\rapidocr\
+ - name: list all file
+ shell: cmd
+ run: |
+ dir c:\rapidocr\opencv\build\x64
+ dir c:\rapidocr\opencv\build\x64\vc15\bin
+ dir c:\rapidocr\
+ - name: Configure CMake
+ # Use a bash shell so we can use the same syntax for environment variable
+ # access regardless of the host operating system
+ shell: bash
+ working-directory: ${{github.workspace}}/build
+ # Note the current convention is to use the -S and -B options here to specify source
+ # and build directories, but this is only available with CMake 3.13 and higher.
+ # The CMake binaries on the Github Actions machines are (as of this writing) 3.12
+ run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
+
+ - name: Build
+ working-directory: ${{github.workspace}}/build
+ shell: bash
+ # Execute the build. You can specify a specific target with "--target <NAME>"
+ run: cmake --build . --config $BUILD_TYPE
+
+ - name: Test
+ working-directory: ${{github.workspace}}/build
+ shell: bash
+ # Execute tests defined by the CMake configuration.
+ # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
+ run: ctest -C $BUILD_TYPE
+
+ - name: PackZip
+ working-directory: ${{github.workspace}}/release
+ shell: cmd
+ run: |
+ mkdir ${{github.workspace}}/release
+ cp ${{github.workspace}}/build/release/rapidocrapi.dll ${{github.workspace}}/release
+ cp ${{github.workspace}}/build/release/rapidocrtest.exe ${{github.workspace}}/release
+ mkdir ${{github.workspace}}\release\lib
+ mkdir ${{github.workspace}}\release\include
+ cp ${{github.workspace}}\build\release\rapidocrapi.lib ${{github.workspace}}\release\lib
+ cp ${{github.workspace}}\include\rapidocr_api.h ${{github.workspace}}\release\include\
+ cp c:\rapidocr\opencv\build\x64\vc15\bin\opencv_world451.dll ${{github.workspace}}\release
+ cp c:\rapidocr\opencv\build\x64\vc15\bin\opencv_world451.dll ${{github.workspace}}\release
+ cp c:/rapidocr/onnxruntime-win-x64-1.7.0/lib/onnxruntime.dll ${{github.workspace}}\release
+ dir /s ${{github.workspace}}\release
+ powershell compress-7zip -path ${{github.workspace}}\release -ArchiveFileName d:\rapidocr-win-x64.zip
+ dir d:\*.zip
+
+ - name: prepare_release
+ uses: srfrnk/current-time@master
+ id: prepare_release
+ with:
+ format: YYYYMMDD_X
+ - name: create_release
+ id: create_release
+ uses: actions/create-release@v1
+ env:
+ # GitHub 会自动创建 GITHUB_TOKEN 密码以在工作流程中使用
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ tag_name: V_${{ steps.prepare_release.outputs.formattedTime }}
+ #${{steps.prepare_release.outputs.tag_name}}
+ release_name: Release rapid_ocr_v1.0_${{ steps.prepare_release.outputs.formattedTime }}
+ draft: false
+ prerelease: false
+ - name: Upload Release Asset
+ id: upload-release-asset
+ # 只有create_release成功得到输出才继续
+ if: steps.create_release.outputs.upload_url
+ uses: actions/upload-release-asset@v1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ steps.create_release.outputs.upload_url }}
+ asset_path: d:\rapidocr-win-x64.zip
+ asset_name: rapidocr-win-x64.zip
+ asset_content_type: application/zip
+