From 68367125e18d30b9d505f90bff3d52cc65b7d537 Mon Sep 17 00:00:00 2001 From: Alex Grintsvayg Date: Mon, 9 Sep 2019 13:47:20 -0400 Subject: [PATCH] gitlab builds on windows what's left: - github build progress notifications (need to upgrade to Gitlab Silver for this) - github releases - uploading coverage results to codecov.io - what directories to cache between builds --- .gitlab-ci.yml | 34 ++++++++++++++++++++++++++++++++++ build/install_choco.ps1 | 11 +++++++++++ 2 files changed, 45 insertions(+) create mode 100644 build/install_choco.ps1 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index adf080991..afb2765af 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -119,6 +119,33 @@ build:mac: after_script: - rm -rf "${VENV}" +build:windows: + extends: .build + tags: [windows] # makes gitlab use the windows runner + variables: + OS: windows + GIT_DEPTH: 5 + before_script: + - ./build/install_choco.ps1 + - choco install -y --x86 python3 7zip checksum +# - python --version | findstr /B "Python 3\.7\." # dont upgrade python on every run. just make sure we're on the right Python +# - pip --version | findstr /E '\(python 3\.7\)' + - pip install virtualenv pywin32 + - virtualenv venv + - venv/Scripts/activate.ps1 + after_script: + - rmdir -Recurse venv + script: + - pip install pyinstaller + - pip install -e torba\. + - cd lbry + - python scripts\set_build.py + - pip install -e . + - pyinstaller --additional-hooks-dir=scripts/. --icon=icons/lbry256.ico -F -n lbrynet lbry/extras/cli.py + - cd dist + - 7z a -tzip $env:CI_PROJECT_DIR/lbrynet-${OS}.zip lbrynet.exe + - checksum --type=sha256 --file=$env:CI_PROJECT_DIR/lbrynet-${OS}.zip + - ./lbrynet.exe --version # upload could be done by making it a yaml alias and putting it right into the build step. that way if one OS fails, the others still get uploaded @@ -146,6 +173,13 @@ s3:mac: dependencies: - build:mac +s3:windows: + extends: .upload + variables: + OS: windows + dependencies: + - build:windows + #release:linux: # stage: release # only: [tags] diff --git a/build/install_choco.ps1 b/build/install_choco.ps1 new file mode 100644 index 000000000..6fc8ed226 --- /dev/null +++ b/build/install_choco.ps1 @@ -0,0 +1,11 @@ +# requires powershell and .NET 4+. see https://chocolatey.org/install for more info. + +$chocoVersion = powershell choco -v +if(-not($chocoVersion)){ + Write-Output "Chocolatey is not installed, installing now" + Write-Output "IF YOU KEEP GETTING THIS MESSAGE ON EVERY BUILD, TRY RESTARTING THE GITLAB RUNNER SO IT GETS CHOCO INTO IT'S ENV" + Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) +} +else{ + Write-Output "Chocolatey version $chocoVersion is already installed" +} \ No newline at end of file