From fd9ff115e3658eca44c3fc1e4c8964a53889f736 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 29 Apr 2022 18:34:48 -0700 Subject: [PATCH] tidy installer building (#11077) * tidy installer building * -d * fix rpm build * try for windows * Install.ps1 -d * move the install.ps1 call out to the workflow * Update build_windows.ps1 * Update build_windows.ps1 * debug non-editable install on windows * platlib and purelib in pyinstaller pathex * Revert "debug non-editable install on windows" This reverts commit 7c0416896945dc5614e713ffd92f6fe9f2cc94cf. * Revert "platlib and purelib in pyinstaller pathex" This reverts commit c5c5cdcd81dff4a9506ba1b4c3d5676afc3b5799. * debug * debug not-editable * Revert "debug not-editable" This reverts commit d4373d8e82a7da62c22f7654266f5fbd8ad553b8. * a bit more similar * git -C * find dlls in site-packages? * oops * Revert "debug" This reverts commit 88090f689f978a11d46c90ac85982bd5e2eea218. * consistently name installer github actions artifact zips * leave SCM_VERSION here * Update build-windows-installer.yml --- .github/workflows/build-windows-installer.yml | 18 +++++-- build_scripts/build_windows.ps1 | 47 +------------------ 2 files changed, 16 insertions(+), 49 deletions(-) diff --git a/.github/workflows/build-windows-installer.yml b/.github/workflows/build-windows-installer.yml index 5ce9ad16a3..037e5f765d 100644 --- a/.github/workflows/build-windows-installer.yml +++ b/.github/workflows/build-windows-installer.yml @@ -21,6 +21,10 @@ jobs: name: Windows 10 Installer runs-on: [windows-2019] timeout-minutes: 50 + strategy: + fail-fast: false + matrix: + python-version: [3.9] steps: - name: Checkout Code @@ -61,9 +65,9 @@ jobs: # We can't upgrade to Python 3.8 until we have a miniupnpc binary - uses: actions/setup-python@v2 - name: Install Python 3.9 + name: Install Python ${{ matrix.python-version }} with: - python-version: "3.9" + python-version: ${{ matrix.python-version }} - name: Setup Node 16.x uses: actions/setup-node@v3 @@ -144,6 +148,12 @@ jobs: Expand-Archive -Path "$env:GITHUB_WORKSPACE\bladebit\bladebit.zip" -DestinationPath "$env:GITHUB_WORKSPACE\bladebit\" rm "$env:GITHUB_WORKSPACE\bladebit\bladebit.zip" + - name: Run install script + env: + INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} + run: | + .\Install.ps1 -d + - name: Build Windows installer with build_scripts\build_windows.ps1 env: CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} @@ -153,7 +163,9 @@ jobs: $env:path="C:\Program` Files` (x86)\Microsoft` Visual` Studio\2019\Enterprise\SDK\ScopeCppSDK\vc15\VC\bin\;$env:path" $env:path="C:\Program` Files` (x86)\Windows` Kits\10\App` Certification` Kit;$env:path" git -C .\chia-blockchain-gui status - .\build_scripts\build_windows.ps1 + .\venv\Scripts\Activate.ps1 + cd .\build_scripts + .\build_windows.ps1 - name: Upload Windows exe's to artifacts uses: actions/upload-artifact@v3 diff --git a/build_scripts/build_windows.ps1 b/build_scripts/build_windows.ps1 index 35bc988f06..34d82643a6 100644 --- a/build_scripts/build_windows.ps1 +++ b/build_scripts/build_windows.ps1 @@ -3,61 +3,16 @@ $ErrorActionPreference = "Stop" mkdir build_scripts\win_build -Set-Location -Path ".\build_scripts\win_build" -PassThru git status -Write-Output " ---" -Write-Output "curl miniupnpc" -Write-Output " ---" -# download.chia.net is the CDN url behind all the files that are actually on pypi.chia.net/simple now -Invoke-WebRequest -Uri "https://download.chia.net/simple/miniupnpc/miniupnpc-2.2.2-cp39-cp39-win_amd64.whl" -OutFile "miniupnpc-2.2.2-cp39-cp39-win_amd64.whl" -Write-Output "Using win_amd64 python 3.9 wheel from https://github.com/miniupnp/miniupnp/pull/475 (2.2.0-RC1)" -Write-Output "Actual build from https://github.com/miniupnp/miniupnp/commit/7783ac1545f70e3341da5866069bde88244dd848" -If ($LastExitCode -gt 0){ - Throw "Failed to download miniupnpc!" -} -else -{ - Set-Location -Path - -PassThru - Write-Output "miniupnpc download successful." -} - -Write-Output " ---" -Write-Output "Create venv - python3.9 is required in PATH" -Write-Output " ---" -.\Install.ps1 -d -. .\venv\Scripts\Activate.ps1 - - -Write-Output " ---" -# The environment variable CHIA_INSTALLER_VERSION needs to be defined - if (-not (Test-Path env:CHIA_INSTALLER_VERSION)) { $env:CHIA_INSTALLER_VERSION = '0.0.0' Write-Output "WARNING: No environment variable CHIA_INSTALLER_VERSION set. Using 0.0.0" - } +} Write-Output "Chia Version is: $env:CHIA_INSTALLER_VERSION" Write-Output " ---" -Write-Output " ---" -Write-Output "Build chia-blockchain wheels" -Write-Output " ---" -pip wheel --use-pep517 --extra-index-url https://pypi.chia.net/simple/ -f . --wheel-dir=.\build_scripts\win_build . - -Write-Output " ---" -Write-Output "Install chia-blockchain wheels into venv with pip" -Write-Output " ---" - -Write-Output "pip install miniupnpc" -Set-Location -Path ".\build_scripts" -PassThru -pip install --no-index --find-links=.\win_build\ miniupnpc -# Write-Output "pip install setproctitle" -# pip install setproctitle==1.2.2 - -Write-Output "pip install chia-blockchain" -pip install --no-index --find-links=.\win_build\ chia-blockchain - Write-Output " ---" Write-Output "Use pyinstaller to create chia .exe's" Write-Output " ---"