Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

整合github action #65

Merged
merged 6 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 45 additions & 47 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,45 @@
#name: Java CI with Maven and Java FX
#
#on:
# push:
# branches: [ "master" ]
# pull_request:
# branches: [ "master" ]
#
#jobs:
# build_windows:
# runs-on: windows-latest
#
# steps:
# - uses: actions/checkout@v3
# - name: Set up JDK 8
# uses: actions/setup-java@v3
# with:
# java-version: '8'
# distribution: 'oracle'
# cache: maven
#
# - name: Download and Extract Models
# run: |
# Invoke-WebRequest -Uri "https://github.com/litongjava/tools-ocr/releases/download/model-ppocr-v4/ch_PP-OCRv4_det_infer-onnx.zip" -OutFile "model_det.zip"
# Invoke-WebRequest -Uri "https://github.com/litongjava/tools-ocr/releases/download/model-ppocr-v4/ch_PP-OCRv4_rec_infer-onnx.zip" -OutFile "model_rec.zip"
# mkdir models\ch_PP-OCRv4_det_infer
# mkdir models\ch_PP-OCRv4_rec_infer
# Expand-Archive "model_det.zip" -DestinationPath "models\ch_PP-OCRv4_det_infer"
# Expand-Archive "model_rec.zip" -DestinationPath "models\ch_PP-OCRv4_rec_infer"
#
# - name: Copy Models
# run: |
# mkdir target\jfx\app
# xcopy models target\jfx\app /E /I
#
#
# - name: Build with Maven
# run: mvn jfx:native -DskipTests
#
# - name : Show Native Files
# run : dir target\jfx\native
# -
# - name: Upload package
# uses: actions/upload-artifact@v3
# with:
# name: treehole-windows-2.2.8.msi
# path: target\jfx\native\treehole-2.2.8.msi
name: Docker JavaFX

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build_windows:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Download and Extract Models
run: |
wget https://github.com/litongjava/tools-ocr/releases/download/model-ppocr-v4/ch_PP-OCRv4_det_infer-onnx.zip
wget https://github.com/litongjava/tools-ocr/releases/download/model-ppocr-v4/ch_PP-OCRv4_rec_infer-onnx.zip
mkdir -p models/ch_PP-OCRv4_det_infer
mkdir -p models/ch_PP-OCRv4_rec_infer
unzip ch_PP-OCRv4_det_infer-onnx.zip -d models/ch_PP-OCRv4_det_infer
unzip ch_PP-OCRv4_rec_infer-onnx.zip -d models/ch_PP-OCRv4_rec_infer

- name: Copy Models
run: |
mkdir -p target/jfx/app
cp -r models target/jfx/app/

- name: Build with Docker
run: |
docker run --rm \
-v ${{ github.workspace }}:/workspace \
-w /workspace \
litongjava/centos-7-maven:3.8.8 \
mvn jfx:native -DskipTests

- name: Show Native Files
run: ls target/jfx/native

- name: Upload package
uses: actions/upload-artifact@v3
with:
name: target-jfx-native-linux-x64
path: target/jfx/native/
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
一款跨平台的 OCR 小工具,调用本地OCR进行识别,无需联网即可使用
用到的技术和框架
- jdk 1.8
- javafx
- djl
- pytorch
- onnx
Expand Down