From 47930b73a5e845be64a1e94b96c7ca67536f5f93 Mon Sep 17 00:00:00 2001 From: shirt-dev <2660574+shirt-dev@users.noreply.github.com> Date: Mon, 15 Feb 2021 14:16:23 -0500 Subject: [PATCH] Fix build.yml hashing and crypto support (#87) Authored-by: shirtjs <2660574+shirtjs@users.noreply.github.com> --- .github/workflows/build.yml | 22 ++++++++++++---------- pyinst.py | 2 +- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 51ca137da..ee7983433 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -55,9 +55,7 @@ jobs: asset_content_type: application/octet-stream - name: Get SHA2-256SUMS for youtube-dlc id: sha2_file - env: - SHA2: ${{ hashFiles('youtube-dlc') }} - run: echo "::set-output name=sha2_unix::$SHA2" + run: echo "::set-output name=sha2_unix::$(sha256sum youtube-dlc)" - name: Install dependencies for pypi run: | python -m pip install --upgrade pip @@ -75,6 +73,9 @@ jobs: runs-on: windows-latest + outputs: + sha2_windows: ${{ steps.sha2_file_win.outputs.sha2_windows }} + needs: build_unix steps: @@ -104,14 +105,15 @@ jobs: asset_content_type: application/vnd.microsoft.portable-executable - name: Get SHA2-256SUMS for youtube-dlc.exe id: sha2_file_win - env: - SHA2_win: ${{ hashFiles('dist/youtube-dlc.exe') }} - run: echo "::set-output name=sha2_windows::$SHA2_win" + run: echo "::set-output name=sha2_windows::$(certUtil -hashfile dist\youtube-dlc.exe SHA256 | findstr -v :)" build_windows32: runs-on: windows-latest + outputs: + sha2_windows32: ${{ steps.sha2_file_win32.outputs.sha2_windows32 }} + needs: [build_unix, build_windows] steps: @@ -121,8 +123,10 @@ jobs: with: python-version: '3.4.4' architecture: 'x86' + - name: Install VS libs + run: choco install vcexpress2010 - name: Install Requirements for 32 Bit - run: pip install pyinstaller==3.5 mutagen Crypto + run: pip install pyinstaller==3.5 mutagen pycryptodome - name: Bump version id: bump_version run: python devscripts/update-version.py @@ -142,9 +146,7 @@ jobs: asset_content_type: application/vnd.microsoft.portable-executable - name: Get SHA2-256SUMS for youtube-dlc_x86.exe id: sha2_file_win32 - env: - SHA2_win32: ${{ hashFiles('dist/youtube-dlc_x86.exe') }} - run: echo "::set-output name=sha2_windows32::$SHA2_win32" + run: echo "::set-output name=sha2_windows32::$(certUtil -hashfile dist\youtube-dlc_x86.exe SHA256 | findstr -v :)" - name: Make SHA2-256SUMS file env: SHA2_WINDOWS: ${{ needs.build_windows.outputs.sha2_windows }} diff --git a/pyinst.py b/pyinst.py index 218b43120..c73a770db 100644 --- a/pyinst.py +++ b/pyinst.py @@ -72,7 +72,7 @@ PyInstaller.__main__.run([ '--exclude-module=test', '--exclude-module=ytdlp_plugins', '--hidden-import=mutagen', - '--hidden-import=%s' % ('Crypto' if _x86 else 'pycryptodome'), + '--hidden-import=pycryptodome', 'youtube_dlc/__main__.py', ]) SetVersion('dist/youtube-dlc%s.exe' % _x86, VERSION_FILE)