From 3715575786fa74a806e80472352f4c2596dac257 Mon Sep 17 00:00:00 2001 From: SWHL Date: Sat, 23 Nov 2024 09:48:21 +0800 Subject: [PATCH] ci: update yml --- .github/workflows/Package.yml | 158 ++++++++++++++++++---------------- 1 file changed, 82 insertions(+), 76 deletions(-) diff --git a/.github/workflows/Package.yml b/.github/workflows/Package.yml index d029593..6004f75 100644 --- a/.github/workflows/Package.yml +++ b/.github/workflows/Package.yml @@ -75,80 +75,86 @@ jobs: zip -r ${{ env.ZIP_NAME }} RapidVideOCR - name: Upload release asset - id: upload-release-asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ZIP_NAME: RapidVideOCR-${{ steps.run_pyinstaller.outputs.VERSION }}-${{ matrix.os }}-${{ runner.arch }}-no-installer_zh.zip - with: - upload_url: ${{ needs.create_release.outputs.upload_url }} - asset_path: dist/${{ env.ZIP_NAME }} - asset_name: ${{ env.ZIP_NAME }} - asset_content_type: application/zip - - build_en: - name: build_en - runs-on: ${{ matrix.os }} - needs: create_release - strategy: - matrix: - os: ['ubuntu-22.04', 'windows-2022', 'ubuntu-20.04'] - - steps: - - name: Pull latest code - uses: actions/checkout@v4 - - - name: Set up Python 3.8 - uses: actions/setup-python@v4 - with: - python-version: '3.8' - architecture: 'x64' - - - name: Display Python version - run: python -c "import sys; print(sys.version)" - - - name: Install env - run: | - pip3 install pyqt5 pyinstaller tqdm rapidocr_onnxruntime get_pypi_latest_version rapid_videocr - - - name: Run pyinstaller - id: run_pyinstaller - shell: bash - run: | - mv ui/* . - - py_path="RapidVideOCR_En.py" - line_num=$(sed -n "/self.version = /=" $py_path) - new_version="${{ github.ref_name }}" - sed -i "${line_num}d" $py_path - sed -i "${line_num}i\ self.version = '${new_version}'" $py_path - - sed -i "s/RapidVideOCR/RapidVideOCR_En/" RapidVideOCR.spec - pyinstaller RapidVideOCR.spec - echo "VERSION=${{ github.ref_name }}" >> $GITHUB_OUTPUT - - - if: matrix.os == 'windows-2022' - name: zip the artifact dir into a zip - env: - ZIP_NAME: RapidVideOCR-${{ steps.run_pyinstaller.outputs.VERSION }}-${{ matrix.os }}-${{ runner.arch }}-no-installer_en.zip - run: | - powershell Compress-Archive ${{ github.workspace }}\dist\RapidVideOCR ${{ github.workspace }}\dist\${{ env.ZIP_NAME }} - - - if: matrix.os != 'windows-2022' - env: - ZIP_NAME: RapidVideOCR-${{ steps.run_pyinstaller.outputs.VERSION }}-${{ matrix.os }}-${{ runner.arch }}-no-installer_en.zip - run: | - cd $GITHUB_WORKSPACE/dist/ - zip -r ${{ env.ZIP_NAME }} RapidVideOCR - - - name: Upload release asset - id: upload-release-asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ZIP_NAME: RapidVideOCR-${{ steps.run_pyinstaller.outputs.VERSION }}-${{ matrix.os }}-${{ runner.arch }}-no-installer_en.zip + uses: softprops/action-gh-release@v2 with: - upload_url: ${{ needs.create_release.outputs.upload_url }} - asset_path: dist/${{ env.ZIP_NAME }} - asset_name: ${{ env.ZIP_NAME }} - asset_content_type: application/zip + files: | + dist/${{ env.ZIP_NAME }} + + # - name: Upload release asset + # id: upload-release-asset + # uses: actions/upload-release-asset@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # ZIP_NAME: RapidVideOCR-${{ steps.run_pyinstaller.outputs.VERSION }}-${{ matrix.os }}-${{ runner.arch }}-no-installer_zh.zip + # with: + # upload_url: ${{ needs.create_release.outputs.upload_url }} + # asset_path: dist/${{ env.ZIP_NAME }} + # asset_name: ${{ env.ZIP_NAME }} + # asset_content_type: application/zip + + # build_en: + # name: build_en + # runs-on: ${{ matrix.os }} + # needs: create_release + # strategy: + # matrix: + # os: ['ubuntu-22.04', 'windows-2022', 'ubuntu-20.04'] + + # steps: + # - name: Pull latest code + # uses: actions/checkout@v4 + + # - name: Set up Python 3.8 + # uses: actions/setup-python@v4 + # with: + # python-version: '3.8' + # architecture: 'x64' + + # - name: Display Python version + # run: python -c "import sys; print(sys.version)" + + # - name: Install env + # run: | + # pip3 install pyqt5 pyinstaller tqdm rapidocr_onnxruntime get_pypi_latest_version rapid_videocr + + # - name: Run pyinstaller + # id: run_pyinstaller + # shell: bash + # run: | + # mv ui/* . + + # py_path="RapidVideOCR_En.py" + # line_num=$(sed -n "/self.version = /=" $py_path) + # new_version="${{ github.ref_name }}" + # sed -i "${line_num}d" $py_path + # sed -i "${line_num}i\ self.version = '${new_version}'" $py_path + + # sed -i "s/RapidVideOCR/RapidVideOCR_En/" RapidVideOCR.spec + # pyinstaller RapidVideOCR.spec + # echo "VERSION=${{ github.ref_name }}" >> $GITHUB_OUTPUT + + # - if: matrix.os == 'windows-2022' + # name: zip the artifact dir into a zip + # env: + # ZIP_NAME: RapidVideOCR-${{ steps.run_pyinstaller.outputs.VERSION }}-${{ matrix.os }}-${{ runner.arch }}-no-installer_en.zip + # run: | + # powershell Compress-Archive ${{ github.workspace }}\dist\RapidVideOCR ${{ github.workspace }}\dist\${{ env.ZIP_NAME }} + + # - if: matrix.os != 'windows-2022' + # env: + # ZIP_NAME: RapidVideOCR-${{ steps.run_pyinstaller.outputs.VERSION }}-${{ matrix.os }}-${{ runner.arch }}-no-installer_en.zip + # run: | + # cd $GITHUB_WORKSPACE/dist/ + # zip -r ${{ env.ZIP_NAME }} RapidVideOCR + + # - name: Upload release asset + # id: upload-release-asset + # uses: actions/upload-release-asset@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # ZIP_NAME: RapidVideOCR-${{ steps.run_pyinstaller.outputs.VERSION }}-${{ matrix.os }}-${{ runner.arch }}-no-installer_en.zip + # with: + # upload_url: ${{ needs.create_release.outputs.upload_url }} + # asset_path: dist/${{ env.ZIP_NAME }} + # asset_name: ${{ env.ZIP_NAME }} + # asset_content_type: application/zip