62
.github/workflows/main.yml
vendored
62
.github/workflows/main.yml
vendored
@@ -10,21 +10,13 @@ on:
|
||||
|
||||
jobs:
|
||||
Linux:
|
||||
outputs:
|
||||
version: ${{ steps.version.outputs.VERSION }}
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
version: ${{ outputs.version }}
|
||||
|
||||
|
||||
steps:
|
||||
- id: version
|
||||
run: echo "::set-output name=VERSION::$(cat AV_Data_Capture.py | grep "version = " | tr -d "version = '")"
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Python 3.8
|
||||
uses: actions/setup-python@v1
|
||||
- name: Setup Python 3.8
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.8
|
||||
|
||||
@@ -37,11 +29,17 @@ jobs:
|
||||
run: |
|
||||
python number_parser.py -v
|
||||
|
||||
- name: Set VERSION variable
|
||||
run: |
|
||||
version=$(python -c 'import AV_Data_Capture; print(AV_Data_Capture.__version__)')
|
||||
echo "::set-env name=VERSION::$version"
|
||||
|
||||
- name: Set CLOUDSCRAPER_PATH variable
|
||||
run: |
|
||||
echo "::set-env name=CLOUDSCRAPER_PATH::$(python -c 'import cloudscraper as _; print(_.__path__[0])' | tail -n 1)"
|
||||
cloudscraper_path=$(python -c 'import cloudscraper as _; print(_.__path__[0])' | tail -n 1)
|
||||
echo "::set-env name=CLOUDSCRAPER_PATH::$cloudscraper_path"
|
||||
|
||||
- name: Build with pyinstaller
|
||||
- name: Build with PyInstaller
|
||||
run: |
|
||||
pyinstaller \
|
||||
--onefile AV_Data_Capture.py \
|
||||
@@ -56,19 +54,17 @@ jobs:
|
||||
- name: Upload build artifact
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: AV_Data_Capture-CLI-${{ env.version }}-Linux
|
||||
name: AV_Data_Capture-CLI-${{ env.VERSION }}-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
|
||||
- name: Setup Python 3.8
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.8
|
||||
|
||||
@@ -81,11 +77,17 @@ jobs:
|
||||
run: |
|
||||
python number_parser.py -v
|
||||
|
||||
- name: Set VERSION variable
|
||||
run: |
|
||||
$env:version=$(python -c 'import AV_Data_Capture; print(AV_Data_Capture.__version__)')
|
||||
echo "::set-env name=VERSION::$env:version"
|
||||
|
||||
- name: Set CLOUDSCRAPER_PATH variable
|
||||
run: |
|
||||
echo "::set-env name=CLOUDSCRAPER_PATH::$(python -c 'import cloudscraper as _; print(_.__path__[0])' | tail -n 1)"
|
||||
$env:cloudscraper_path=$(python -c 'import cloudscraper as _; print(_.__path__[0])' | select -Last 1)
|
||||
echo "::set-env name=CLOUDSCRAPER_PATH::$env:cloudscraper_path"
|
||||
|
||||
- name: Build with pyinstaller
|
||||
- name: Build with PyInstaller
|
||||
run: |
|
||||
pyinstaller `
|
||||
--onefile AV_Data_Capture.py `
|
||||
@@ -100,19 +102,17 @@ jobs:
|
||||
- name: Upload build artifact
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: AV_Data_Capture-CLI-${{ needs.Linux.env.version }}-Windows
|
||||
name: AV_Data_Capture-CLI-${{ env.VERSION }}-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
|
||||
- name: Setup Python 3.8
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.8
|
||||
|
||||
@@ -125,11 +125,17 @@ jobs:
|
||||
run: |
|
||||
python number_parser.py -v
|
||||
|
||||
- name: Set VERSION variable
|
||||
run: |
|
||||
version=$(python -c 'import AV_Data_Capture; print(AV_Data_Capture.__version__)')
|
||||
echo "::set-env name=VERSION::$version"
|
||||
|
||||
- name: Set CLOUDSCRAPER_PATH variable
|
||||
run: |
|
||||
echo "::set-env name=CLOUDSCRAPER_PATH::$(python -c 'import cloudscraper as _; print(_.__path__[0])' | tail -n 1)"
|
||||
cloudscraper_path=$(python -c 'import cloudscraper as _; print(_.__path__[0])' | tail -n 1)
|
||||
echo "::set-env name=CLOUDSCRAPER_PATH::$cloudscraper_path"
|
||||
|
||||
- name: Build with pyinstaller
|
||||
- name: Build with PyInstaller
|
||||
run: |
|
||||
pyinstaller \
|
||||
--onefile AV_Data_Capture.py \
|
||||
@@ -144,5 +150,5 @@ jobs:
|
||||
- name: Upload build artifact
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: AV_Data_Capture-CLI-${{ needs.Linux.env.version }}-MacOS
|
||||
name: AV_Data_Capture-CLI-${{ env.VERSION }}-MacOS
|
||||
path: dist
|
||||
|
||||
@@ -59,6 +59,8 @@ def get_html(url, cookies: dict = None, ua: str = None, return_type: str = None)
|
||||
|
||||
if return_type == "object":
|
||||
return result
|
||||
elif return_type == "json":
|
||||
return result.json()
|
||||
else:
|
||||
return result.text
|
||||
|
||||
|
||||
@@ -3,15 +3,14 @@ from core import *
|
||||
import os
|
||||
from number_parser import get_number
|
||||
|
||||
__version__ = '3.7.1'
|
||||
|
||||
def check_update(local_version):
|
||||
data = json.loads(get_html("https://api.github.com/repos/yoshiko2/AV_Data_Capture/releases/latest"))
|
||||
def check_update():
|
||||
latest = get_html("https://api.github.com/repos/yoshiko2/AV_Data_Capture/releases/latest",
|
||||
return_type="json")["tag_name"]
|
||||
|
||||
remote = data["tag_name"]
|
||||
local = local_version
|
||||
|
||||
if not local == remote:
|
||||
line1 = "* New update " + str(remote) + " *"
|
||||
if __version__ != latest:
|
||||
line1 = "* New update " + str(latest) + " *"
|
||||
print("[*]" + line1.center(54))
|
||||
print("[*]" + "↓ Download ↓".center(54))
|
||||
print("[*] https://github.com/yoshiko2/AV_Data_Capture/releases")
|
||||
@@ -111,7 +110,6 @@ def create_data_and_move_with_custom_number(file_path: str, c: config.Config, cu
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
version = '3.7.1'
|
||||
|
||||
# Parse command line args
|
||||
single_file_path, config_file, auto_exit, custom_number = argparse_function()
|
||||
@@ -119,13 +117,13 @@ if __name__ == '__main__':
|
||||
# Read config.ini
|
||||
conf = config.Config(path=config_file)
|
||||
|
||||
version_print = 'Version ' + version
|
||||
version_print = 'Version ' + __version__
|
||||
print('[*]================== AV Data Capture ===================')
|
||||
print('[*]' + version_print.center(54))
|
||||
print('[*]======================================================')
|
||||
|
||||
if conf.update_check():
|
||||
check_update(version)
|
||||
check_update()
|
||||
|
||||
create_failed_folder(conf.failed_folder())
|
||||
os.chdir(os.getcwd())
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
pyinstaller --onefile AV_Data_Capture.py --hidden-import ADC_function.py --hidden-import core.py
|
||||
pyinstaller --onefile AV_Data_Capture.py --hidden-import ADC_function.py --hidden-import core.py
|
||||
rmdir /s/q build
|
||||
rmdir /s/q __pycache__
|
||||
pause
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
. "version": "3.7.1",
|
||||
"version": "3.7.1",
|
||||
"version_show": "3.7.1",
|
||||
"download": "https://github.com/yoshiko2/AV_Data_Capture/releases"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user