From 85cfcee4bb620b8e8d3192cae70688aa2f832868 Mon Sep 17 00:00:00 2001 From: 68cdrBxM8YdoJ <68cdrBxM8YdoJ@gmail.com> Date: Tue, 5 May 2020 17:16:38 +0900 Subject: [PATCH] Change to use dynamically fetched paths --- .github/workflows/main.yml | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b4ecd9a..6a8f3ea 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,32 +32,27 @@ jobs: run: | python number_parser.py -v -# - name: Show cloudsraper package location -# run: | -# python -c 'import cloudscraper as _; print(_.__path__)' + - name: Set CLOUDSCRAPER_PATH variable + run: | + echo "::set-env name=CLOUDSCRAPER_PATH::$(python -c 'import cloudscraper as _; print(_.__path__[0])' | tail -n 1)" - name: Build with pyinstaller (windows) if: matrix.os == 'windows-latest' run: | - pyinstaller --onefile AV_Data_Capture.py --hidden-import ADC_function.py --hidden-import core.py --add-data='C:\\hostedtoolcache\\windows\\Python\\3.7.6\\x64\\lib\\site-packages\\cloudscraper\\;cloudscraper' + pyinstaller ` + --onefile AV_Data_Capture.py ` + --hidden-import ADC_function.py ` + --hidden-import core.py ` + --add-data "$env:CLOUDSCRAPER_PATH;cloudscraper" - - name: Build with pyinstaller (mac) - if: matrix.os == 'macos-latest' + - name: Build with pyinstaller (mac/ubuntu) + if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest' run: | pyinstaller \ --onefile AV_Data_Capture.py \ --hidden-import ADC_function.py \ --hidden-import core.py \ - --add-data='/Users/runner/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/cloudscraper/:cloudscraper' - - - name: Build with pyinstaller (ubuntu) - if: matrix.os == 'ubuntu-latest' - run: | - pyinstaller \ - --onefile AV_Data_Capture.py \ - --hidden-import ADC_function.py \ - --hidden-import core.py \ - --add-data='/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/cloudscraper/:cloudscraper' + --add-data "$CLOUDSCRAPER_PATH:cloudscraper" - name: Copy config.ini run: |