feat: 用工厂函数模式重构复制和保存函数,提高代码的复用性和可拓展性 #48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build | |
| on: | |
| push: | |
| branches: [ master, main ] | |
| pull_request: | |
| branches: [ master, main ] | |
| jobs: | |
| build-macos: | |
| runs-on: macos-13 # 使用 Intel macOS 以支持 x64 Qt 5.15.2 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Install Qt | |
| uses: jurplel/install-qt-action@v3 | |
| with: | |
| version: '5.15.2' | |
| host: 'mac' | |
| arch: 'x64' | |
| - name: Install Dependencies | |
| run: | | |
| # Install dependencies for Intel macOS | |
| brew update | |
| brew install opencv tesseract | |
| - name: Configure Project (local_config.pri) | |
| run: | | |
| # Generate a local config for CI environment | |
| # Note: Intel macOS (macos-13) uses /usr/local for Homebrew | |
| # Qt 5.15.2 on Intel macOS is x86_64. | |
| echo "macx: {" > local_config.pri | |
| echo " DEFINES += USE_TESSERACT" >> local_config.pri | |
| echo " INCLUDEPATH += /usr/local/include" >> local_config.pri | |
| echo " LIBS += -L/usr/local/lib -ltesseract -lleptonica" >> local_config.pri | |
| echo " INCLUDEPATH += /usr/local/opt/opencv/include/opencv4" >> local_config.pri | |
| echo " LIBS += -L/usr/local/opt/opencv/lib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_imgcodecs -lopencv_videoio -lopencv_dnn -lopencv_objdetect" >> local_config.pri | |
| echo "}" >> local_config.pri | |
| - name: Build | |
| run: | | |
| qmake ScreenSniper.pro | |
| make |