diff --git a/.circleci/config.yml b/.circleci/config.yml index ea3c3c0f..f6114200 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -83,7 +83,6 @@ jobs: command: | choco install python --version=3.9.12 choco install 7zip - choco install go - run: name: Install poetry command: (Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py -UseBasicParsing).Content | python - @@ -123,36 +122,37 @@ jobs: - run: name: Install chocolately dependencies command: | - choco install python3 --params "/InstallDir32:C:\Python39-32bit" --version=3.9.12 + choco install python3 --params "/InstallDir32:C:\Python-32bit" --version=3.9.12 choco install 7zip - run: name: Install golang (32-bit) command: | - Invoke-WebRequest -Uri https://go.dev/dl/go1.18.windows-386.msi -OutFile ~\Downloads\go1.18.windows-386.msi - msiexec.exe /i "~\Downloads\go1.18.windows-386.msi" /qn + cd ~\Downloads + Invoke-WebRequest -Uri https://go.dev/dl/go1.18.windows-386.msi -OutFile go1.18.windows-386.msi + msiexec.exe /i go1.18.windows-386.msi /quiet /L*V go-install.log - run: name: Install poetry (32-bit) - command: C:\Python39-32bit\Scripts\pip install poetry + command: C:\Python-32bit\Scripts\pip install poetry - run: name: Install poetry dependencies command: | cd ~\project\desktop - C:\Python39-32bit\Scripts\poetry install + C:\Python-32bit\Scripts\poetry install - run: name: Get tor command: | cd ~\project\desktop - C:\Python39-32bit\Scripts\poetry run python .\scripts\get-tor-windows.py + C:\Python-32bit\Scripts\poetry run python .\scripts\get-tor-windows.py - run: name: Build meek command: | cd ~\project\desktop - C:\Python39-32bit\python .\scripts\build-meek-client.py + C:\Python-32bit\python .\scripts\build-meek-client.py - run: name: Build command: | cd ~\project\desktop - C:\Python39-32bit\Scripts\poetry run python .\package\build-windows.py --ci-build + C:\Python-32bit\Scripts\poetry run python .\package\build-windows.py --ci-build - run: name: Compress command: Compress-Archive -LiteralPath ~\project\desktop\build\exe.win32-3.9 -DestinationPath ~\onionshare-win32.zip diff --git a/desktop/package/build-windows.py b/desktop/package/build-windows.py index d9e78f95..1cce529f 100644 --- a/desktop/package/build-windows.py +++ b/desktop/package/build-windows.py @@ -162,6 +162,18 @@ def wix_build_components_xml(root, data): def main(): + # Figure out the architecture and python path + if "64 bit" in sys.version: + python_arch = "win-amd64" + else: + python_arch = "win32" + + if os.getlogin() == "circleci" and python_arch == "win32": + python_path = "C:\\Python-32bit\\python" + else: + python_path = shutil.which("python") + + # Arguments parser = argparse.ArgumentParser( formatter_class=lambda prog: argparse.HelpFormatter(prog, max_help_position=48) ) @@ -185,17 +197,13 @@ def main(): print("> Building binaries") run( [ - "python", + python_path, "setup-freeze.py", "build", ], desktop_dir, ) - if "64 bit" in sys.version: - python_arch = "win-amd64" - else: - python_arch = "win32" build_path = os.path.join(desktop_dir, "build", f"exe.{python_arch}-3.9") # before_size = get_size(build_path) diff --git a/desktop/scripts/build-meek-client.py b/desktop/scripts/build-meek-client.py index 3d81d62f..a33e314b 100755 --- a/desktop/scripts/build-meek-client.py +++ b/desktop/scripts/build-meek-client.py @@ -26,13 +26,25 @@ and hard-code the sha256 hash. """ import shutil import os +import sys import subprocess import inspect import platform def main(): - if shutil.which("go") is None: + # Figure out the architecture and python path + if "64 bit" in sys.version: + python_arch = "win-amd64" + else: + python_arch = "win32" + + if os.getlogin() == "circleci" and python_arch == "win32": + go_path = "C:\\Program Files (x86)\\Go\\bin\\go" + else: + go_path = shutil.which("go") + + if go_path is None: print("Install go: https://golang.org/doc/install") return