Skip to content

Commit

Permalink
add auto update action
Browse files Browse the repository at this point in the history
  • Loading branch information
T-Dynamos committed Jan 7, 2024
1 parent c01dd27 commit e0c7c0f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 8 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Font update

on:
schedule:
- cron: '0 0 * * 0'
push:
branches:
- main

jobs:
generate-and-push:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.12

- name: Generate fonts
run: |
sudo apt install woff2
python generator.py
- name: Commit and push changes
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
git add .
git commit -m "Weekly font update"
git push
9 changes: 1 addition & 8 deletions generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,8 @@ def generate_sha256sum():
.split(" ")[0]
)
with open("checksum.json", "w") as file:
json.dump(final_data, file)
json.dump(final_data, file, indent = 4)
file.close()
if shutil.which("black"):
os.system("black checksum.json")
else:
print(
"Warning: black code formater was not found, json text won't be human readable"
)


def main():
TOTAL_DOWNLOADED = 0
Expand Down

0 comments on commit e0c7c0f

Please sign in to comment.