Skip to content

Commit c6848be

Browse files
committed
Fix a bug with the workflow
1 parent ecf1012 commit c6848be

10 files changed

Lines changed: 1022 additions & 9 deletions

File tree

.github/scripts/build_assets/PathResolverAction.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@
55
class PathResolverAction(argparse.Action):
66
def __call__(self, parser, namespace, values, option_string=None):
77
path = Path(values).resolve()
8-
if not self.dest == "download_path":
9-
if not path.exists():
10-
raise ValueError(f"{path} doesn't exist.")
8+
if not path.exists():
9+
raise ValueError(f"{path} doesn't exist.")
1110

1211
if self.dest == "icons_folder_path":
1312
if not path.is_dir():
1413
raise ValueError("icons_folder_path must be a directory")
14+
15+
elif self.dest == "download_path":
16+
if not path.is_dir():
17+
raise ValueError("download_path must be a directory")
1518

1619
setattr(namespace, self.dest, str(path))

.github/scripts/build_assets/SeleniumRunner.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ class SeleniumRunner:
1919
"""
2020
The long wait time for the driver in seconds.
2121
"""
22-
LONG_WAIT_IN_SEC = 20
22+
LONG_WAIT_IN_SEC = 25
2323

2424
"""
2525
The medium wait time for the driver in seconds.
2626
"""
27-
MED_WAIT_IN_SEC = 5
27+
MED_WAIT_IN_SEC = 6
2828

2929
"""
3030
The short wait time for the driver in seconds.
@@ -81,7 +81,7 @@ def upload_icomoon(self):
8181
Upload the icomoon.json to icomoon.io.
8282
:raises TimeoutException: happens when elements are not found.
8383
"""
84-
print("Uploading JSON file...")
84+
print("Uploading icomoon.json file...")
8585
try:
8686
# find the file input and enter the file path
8787
import_btn = WebDriverWait(self.driver, SeleniumRunner.LONG_WAIT_IN_SEC).until(

.github/scripts/icomoon_upload.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,11 @@ def main():
4545
runner = SeleniumRunner(args.icomoon_json_path, args.download_path,
4646
args.geckodriver_path, args.headless)
4747
runner.upload_icomoon()
48-
4948
svgs = filehandler.get_svgs_paths(new_icons, args.icons_folder_path)
5049
runner.upload_svgs(svgs)
5150

52-
# get the downloaded zip file
53-
zip_name = next(Path(".").glob("devicon-*.zip"))
51+
52+
zip_name = "devicon-v1.0.zip"
5453
zip_path = Path(args.download_path, zip_name)
5554
runner.download_icomoon_fonts(zip_path)
5655
filehandler.extract_files(str(zip_path), args.download_path)

.github/workflows/build_icons.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ jobs:
3030
with:
3131
commit_message: Built new icons, icomoon.json and devicon.css
3232
branch: build-integrate
33+
ref: ${{ github.head_ref }}

0 commit comments

Comments
 (0)