diff --git a/.github/scripts/build_assets/filehandler.py b/.github/scripts/build_assets/filehandler.py index 0fe3e1a5..10272ccd 100644 --- a/.github/scripts/build_assets/filehandler.py +++ b/.github/scripts/build_assets/filehandler.py @@ -59,6 +59,7 @@ def get_svgs_paths(new_icons: List[dict], icons_folder_path: str) -> List[str]: if not folder_path.is_dir(): raise ValueError(f"Invalid path. This is not a directory: {folder_path}.") + # TODO: remove the try-except when the devicon.json is upgraded try: aliases = icon_info["aliases"] except KeyError: diff --git a/.github/scripts/icomoon_upload.py b/.github/scripts/icomoon_upload.py index c4eac1b0..45206838 100644 --- a/.github/scripts/icomoon_upload.py +++ b/.github/scripts/icomoon_upload.py @@ -1,5 +1,6 @@ from pathlib import Path from argparse import ArgumentParser +from selenium.common.exceptions import TimeoutException # pycharm complains that build_assets is an unresolved ref # don't worry about it, the script still runs @@ -42,20 +43,25 @@ def main(): print("No files need to be uploaded. Ending script...") return - runner = SeleniumRunner(args.icomoon_json_path, args.download_path, - args.geckodriver_path, args.headless) - runner.upload_icomoon() - svgs = filehandler.get_svgs_paths(new_icons, args.icons_folder_path) - runner.upload_svgs(svgs) + try: + runner = SeleniumRunner(args.icomoon_json_path, args.download_path, + args.geckodriver_path, args.headless) + runner.upload_icomoon() + svgs = filehandler.get_svgs_paths(new_icons, args.icons_folder_path) + runner.upload_svgs(svgs) - zip_name = "devicon-v1.0.zip" - zip_path = Path(args.download_path, zip_name) - runner.download_icomoon_fonts(zip_path) - filehandler.extract_files(str(zip_path), args.download_path) - filehandler.rename_extracted_files(args.download_path) - runner.close() - print("Task completed.") + zip_name = "devicon-v1.0.zip" + zip_path = Path(args.download_path, zip_name) + runner.download_icomoon_fonts(zip_path) + filehandler.extract_files(str(zip_path), args.download_path) + filehandler.rename_extracted_files(args.download_path) + runner.close() + print("Task completed.") + except TimeoutException as e: + print(e) + print(e.stacktrace) + runner.close() if __name__ == "__main__": diff --git a/.github/scripts/requirements.txt b/.github/scripts/requirements.txt index 954f0db0..27bc3be5 100644 --- a/.github/scripts/requirements.txt +++ b/.github/scripts/requirements.txt @@ -1 +1 @@ -selenium \ No newline at end of file +selenium==3.141.0 \ No newline at end of file diff --git a/.github/workflows/build_icons.yml b/.github/workflows/build_icons.yml index a89c2442..badcb69e 100644 --- a/.github/workflows/build_icons.yml +++ b/.github/workflows/build_icons.yml @@ -2,7 +2,10 @@ name: Build Icons on: pull_request: branches: - - build-integrate + - master + push: + branches: + - master jobs: build: name: Get Fonts From Icomoon @@ -23,9 +26,13 @@ jobs: run: > python ./.github/scripts/icomoon_upload.py ./.github/scripts/build_assets/geckodriver-v0.27.0-win64/geckodriver.exe - ./icomoon.json ./devicon.json ./icons ./built_files --headless + ./icomoon.json ./devicon.json ./icons ./ --headless + - name: Upload geckodriver.log for debugging purposes + uses: actions/upload-artifact@v2 + with: + path: ./geckodriver.log - name: Commit changes uses: stefanzweifel/git-auto-commit-action@v4 with: commit_message: Built new icons, icomoon.json and devicon.css - branch: action-fix + branch: build-integrate