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