From e1da7fc7022fb6a080f3ecc1898bfe6b332de184 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Tue, 19 Apr 2022 21:42:37 -0400 Subject: [PATCH] Cache deps in win64 and win32 --- .circleci/config.yml | 60 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 56 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b8ff8c1a..78d0d4a6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -98,11 +98,17 @@ jobs: Invoke-WebRequest -Uri $URL -OutFile $Filename $FileHash = Get-FileHash $Filename if($FileHash.Hash -ne $ExpectedHash) { throw "Invalid hash" } - Expand-Archive -LiteralPath tor-win32-0.4.6.10.zip -DestinationPath ~\project\desktop\onionshare\resources\tor + mkdir ~\Downloads\tor\tor-win32 + Expand-Archive -LiteralPath tor-win32-0.4.6.10.zip -DestinationPath ~\Downloads\tor\tor-win32 - save_cache: key: download-tor-win32-0.4.6.10 paths: - ~\project\desktop\onionshare\resources\tor + - run: + name: Copy tor binary into app + command: cp ~\Downloads\tor\tor-win32\* ~\project\desktop\onionshare\resources\tor + - restore_cache: + key: build-win64-obfs4proxy-v0.0.13 - run: name: Build obfs4proxy command: | @@ -110,18 +116,35 @@ jobs: cd Downloads\obfs4proxy git clone https://gitlab.com/yawning/obfs4 cd obfs4 + git checkout obfs4proxy-0.0.13 go build .\obfs4proxy Move-Item -Path .\obfs4proxy.exe -Destination ~\project\desktop\onionshare\resources\tor\Tor\obfs4proxy.exe + - save_cache: + key: build-win64-obfs4proxy-v0.0.13 + paths: + - ~\project\desktop\onionshare\resources\tor\Tor\obfs4proxy.exe + - restore_cache: + key: build-win64-snowflake-v2.1.0 - run: name: Build snowflake-client command: | - go install git.torproject.org/pluggable-transports/snowflake.git/client@latest + go install git.torproject.org/pluggable-transports/snowflake.git/client@v2.1.0 Move-Item -Path ~\go\bin\client.exe -Destination ~\project\desktop\onionshare\resources\tor\Tor\snowflake-client.exe + - save_cache: + key: build-win64-snowflake-v2.1.0 + paths: + - ~\project\desktop\onionshare\resources\tor\Tor\snowflake-client.exe + - restore_cache: + key: build-win64-meek-v0.37.0 - run: name: Build meek-client command: | go install git.torproject.org/pluggable-transports/meek.git/meek-client@v0.37.0 Move-Item -Path ~\go\bin\meek-client.exe -Destination ~\project\desktop\onionshare\resources\tor\Tor\meek-client.exe + - save_cache: + key: build-win64-meek-v0.37.0 + paths: + - ~\project\desktop\onionshare\resources\tor\Tor\meek-client.exe - run: name: Build OnionShare command: | @@ -160,6 +183,8 @@ jobs: command: | cd ~\project\desktop C:\Python-32bit\Scripts\poetry install + - restore_cache: + key: download-tor-win32-0.4.6.10 - run: name: Download tor (Windows Expert Bundle) command: | @@ -171,26 +196,53 @@ jobs: Invoke-WebRequest -Uri $URL -OutFile $Filename $FileHash = Get-FileHash $Filename if($FileHash.Hash -ne $ExpectedHash) { throw "Invalid hash" } - Expand-Archive -LiteralPath tor-win32-0.4.6.10.zip -DestinationPath ~\project\desktop\onionshare\resources\tor + mkdir ~\Downloads\tor\tor-win32 + Expand-Archive -LiteralPath tor-win32-0.4.6.10.zip -DestinationPath ~\Downloads\tor\tor-win32 + - save_cache: + key: download-tor-win32-0.4.6.10 + paths: + - ~\project\desktop\onionshare\resources\tor + - run: + name: Copy tor binary into app + command: cp ~\Downloads\tor\tor-win32\* ~\project\desktop\onionshare\resources\tor + - restore_cache: + key: build-win32-obfs4proxy-v0.0.13 - run: name: Build obfs4proxy command: | mkdir ~\Downloads\obfs4proxy cd Downloads\obfs4proxy git clone https://gitlab.com/yawning/obfs4 + git checkout obfs4proxy-0.0.13 cd obfs4 "C:\\Program Files (x86)\\Go\\bin\\go" build .\obfs4proxy Move-Item -Path .\obfs4proxy.exe -Destination ~\project\desktop\onionshare\resources\tor\Tor\obfs4proxy.exe + - save_cache: + key: build-win32-obfs4proxy-v0.0.13 + paths: + - ~\project\desktop\onionshare\resources\tor\Tor\obfs4proxy.exe + - restore_cache: + key: build-win32-snowflake-v2.1.0 - run: name: Build snowflake-client command: | - "C:\\Program Files (x86)\\Go\\bin\\go" install git.torproject.org/pluggable-transports/snowflake.git/client@latest + "C:\\Program Files (x86)\\Go\\bin\\go" install git.torproject.org/pluggable-transports/snowflake.git/client@v2.1.0 Move-Item -Path ~\go\bin\client.exe -Destination ~\project\desktop\onionshare\resources\tor\Tor\snowflake-client.exe + - save_cache: + key: build-win32-snowflake-v2.1.0 + paths: + - ~\project\desktop\onionshare\resources\tor\Tor\snowflake-client.exe + - restore_cache: + key: build-win32-meek-v0.37.0 - run: name: Build meek-client command: | "C:\\Program Files (x86)\\Go\\bin\\go" install git.torproject.org/pluggable-transports/meek.git/meek-client@v0.37.0 Move-Item -Path ~\go\bin\meek-client.exe -Destination ~\project\desktop\onionshare\resources\tor\Tor\meek-client.exe + - save_cache: + key: build-win32-meek-v0.37.0 + paths: + - ~\project\desktop\onionshare\resources\tor\Tor\meek-client.exe - run: name: Build OnionShare command: |