From d6062c9664554789fe699f697384a868ede9354e Mon Sep 17 00:00:00 2001 From: Tim Yuen Date: Sat, 10 Sep 2022 16:55:47 -0400 Subject: [PATCH] fix actions/upload-artifact generating tar bombs, change how make_exe.bat works --- .github/workflows/create-binaries.yaml | 24 +++++++++++++++++++++--- make_exe.bat | 8 ++++---- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/.github/workflows/create-binaries.yaml b/.github/workflows/create-binaries.yaml index 352f345..a705d7b 100644 --- a/.github/workflows/create-binaries.yaml +++ b/.github/workflows/create-binaries.yaml @@ -6,7 +6,8 @@ on: workflow_dispatch: env: - dist-folder-path: dist/OpenSeeFace + dist-folder-path: dist/OpenSeeFace # The directory generated by PyInstaller + artifact-path: OpenSeeFace # Needed since upload-artifacts pulls files out of parent directories jobs: build-all: @@ -19,21 +20,38 @@ jobs: - name: Pull OpenSeeFace uses: actions/checkout@v3 - - name: Create binary + - name: Create binary Unix + if: matrix.os != 'windows-latest' shell: bash run: | chmod +x make_exe.sh ./make_exe.sh + - name: Create binary Windows + if: matrix.os == 'windows-latest' + shell: cmd + run: | + choco install vcredist140 + + xcopy c:\Windows\System32\msvcp140.dll . + xcopy c:\Windows\System32\vcomp140.dll . + xcopy c:\Windows\System32\concrt140.dll . + xcopy c:\Windows\System32\vccorlib140.dll . + + make_exe.bat + - name: Move and zip files shell: bash # Using bash for all OSs should be fine, even on Windows run: | mv dist/facetracker ${{ env.dist-folder-path }} cp -r models ${{ env.dist-folder-path }} + mkdir ${{ env.artifact-path }} + mv ${{ env.dist-folder-path }} ${{ env.artifact-path }} + - name: Upload artifact uses: actions/upload-artifact@v3 with: name: ${{ matrix.os }} - path: ${{ env.dist-folder-path }} + path: ${{ env.artifact-path }} if-no-files-found: error diff --git a/make_exe.bat b/make_exe.bat index a5ad490..36c6f62 100644 --- a/make_exe.bat +++ b/make_exe.bat @@ -1,4 +1,6 @@ -pyinstaller facetracker.spec --onedir ^ +pip install onnxruntime opencv-python==4.5.4.60 pillow numpy pyinstaller + +pyinstaller facetracker.py --onedir ^ --add-binary dshowcapture/dshowcapture_x86.dll;. ^ --add-binary dshowcapture/dshowcapture_x64.dll;. ^ --add-binary dshowcapture/libminibmcapture32.dll;. ^ @@ -11,6 +13,4 @@ pyinstaller facetracker.spec --onedir ^ --add-binary vccorlib140.dll;. ^ --add-binary run.bat;. -del dist\facetracker\cv2\opencv_videoio_ffmpeg420_64.dll - -pause \ No newline at end of file +del dist\facetracker\cv2\opencv_videoio_* \ No newline at end of file