Skip to content

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

Update windows-build.yml

Daniel55bf875928d1
diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml
index c7c0e34..9201c12 100644
--- a/.github/workflows/windows-build.yml
+++ b/.github/workflows/windows-build.yml
@@ -1,6 +1,12 @@
-name: CMake
+name: CMake-windows
-on: [push]
+on:
+ push:
+ branches:
+ - 'main'
+ tags:
+ - "*"
+
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
@@ -8,6 +14,7 @@ env:
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.
@@ -76,6 +83,7 @@ jobs:
# 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
@@ -93,3 +101,38 @@ jobs:
dir /s ${{github.workspace}}\release
powershell compress-7zip -path ${{github.workspace}}\release -ArchiveFileName d:\rapidocr-win-x64.zip
dir d:\*.zip
+ deploy:
+ name: Upload Release Asset
+ # 依赖上一个job
+ needs: build
+ runs-on: windows-latest
+ # 只在tag时执行,即在自己终端运行以下代码后才会触发
+ # git tag -a v0.1.0 -m "release 0.1.0 version"
+ # git push origin –-tags
+ #if: contains(github.ref, 'tags/')
+ steps:
+
+ - name: create_release
+ id: create_release
+ uses: actions/create-release@v1
+ env:
+ # GitHub 会自动创建 GITHUB_TOKEN 密码以在工作流程中使用
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ tag_name: ${{steps.prepare_release.outputs.tag_name}}
+ release_name: Release ${{steps.prepare_release.outputs.tag_name}} by M.Y
+ 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
+