144 lines
3.4 KiB
YAML
144 lines
3.4 KiB
YAML
name: PyInstaller
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
Linux:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
run: |
|
|
echo "::set-env name=VERSION::$(cat AV_Data_Capture.py | grep "version = " | tr -d "version = '")"
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up Python 3.8
|
|
uses: actions/setup-python@v1
|
|
with:
|
|
python-version: 3.8
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
|
|
- name: Test number_perser.get_number
|
|
run: |
|
|
python number_parser.py -v
|
|
|
|
- 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
|
|
run: |
|
|
pyinstaller \
|
|
--onefile AV_Data_Capture.py \
|
|
--hidden-import ADC_function.py \
|
|
--hidden-import core.py \
|
|
--add-data "$CLOUDSCRAPER_PATH:cloudscraper"
|
|
|
|
- name: Copy config.ini
|
|
run: |
|
|
cp config.ini dist/
|
|
|
|
- name: Upload build artifact
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: AV_Data_Capture-CLI-${{ env.run }}-Linux
|
|
path: dist
|
|
|
|
|
|
Windows:
|
|
runs-on: windows-latest
|
|
needs: Linux
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up Python 3.8
|
|
uses: actions/setup-python@v1
|
|
with:
|
|
python-version: 3.8
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
|
|
- name: Test number_perser.get_number
|
|
run: |
|
|
python number_parser.py -v
|
|
|
|
- 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
|
|
run: |
|
|
pyinstaller `
|
|
--onefile AV_Data_Capture.py `
|
|
--hidden-import ADC_function.py `
|
|
--hidden-import core.py `
|
|
--add-data "$env:CLOUDSCRAPER_PATH;cloudscraper"
|
|
|
|
- name: Copy config.ini
|
|
run: |
|
|
cp config.ini dist/
|
|
|
|
- name: Upload build artifact
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: AV_Data_Capture-CLI-${{ needs.Linux.env.run }}-Windows
|
|
path: dist
|
|
|
|
|
|
MacOS:
|
|
needs: Linux
|
|
runs-on: macos-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up Python 3.8
|
|
uses: actions/setup-python@v1
|
|
with:
|
|
python-version: 3.8
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
|
|
- name: Test number_perser.get_number
|
|
run: |
|
|
python number_parser.py -v
|
|
|
|
- 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
|
|
run: |
|
|
pyinstaller \
|
|
--onefile AV_Data_Capture.py \
|
|
--hidden-import ADC_function.py \
|
|
--hidden-import core.py \
|
|
--add-data "$CLOUDSCRAPER_PATH:cloudscraper"
|
|
|
|
- name: Copy config.ini
|
|
run: |
|
|
cp config.ini dist/
|
|
|
|
- name: Upload build artifact
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: AV_Data_Capture-CLI-${{ needs.Linux.env.run }}-MacOS
|
|
path: dist
|