Skip to content

Commit

Permalink
feat: set output path to project directory & streamline output props
Browse files Browse the repository at this point in the history
  • Loading branch information
wax911 committed Feb 23, 2025
1 parent b1ea206 commit f03511c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/emoji-data-updater.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ on:
workflow_dispatch:
schedule:
- cron: "0 2 * * 5"

jobs:
update-emoji-json:
runs-on: ubuntu-latest
env:
VERSION:
RELEASE_URL:
VERSION: ''
RELEASE_URL: ''
WORKING_DIR: scripts/emoji_generator
steps:
- name: Checkout Repository
Expand Down Expand Up @@ -40,7 +40,9 @@ jobs:
env:
PYTHONUNBUFFERED: 1
EMOJI_VERSION: ${{ env.VERSION }}
run: poetry run python ${{ env.WORKING_DIR }}/emoji_generator/generator.py
run: |
cd ${{ env.WORKING_DIR }}
poetry run python emoji_generator/generator.py
- name: Push Changes and Create PR
uses: peter-evans/create-pull-request@v7
Expand All @@ -49,7 +51,7 @@ jobs:
title: "Update emoji.json to emojibase-data@${{ env.VERSION }}"
body: |
This PR updates emoji.json to the latest version of emojibase-data: `emojibase-data@${{ env.VERSION }}`.
You can review the release notes [here](${{ env.RELEASE_URL }}).
branch: dependencies/emoji-base-updates
author: GitHub <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion scripts/emoji_generator/emoji_generator/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def initialize() -> NoReturn:

emoji_output = fetch_emoji_data()

output_path = 'emojify/src/main/assets/emoticons/emoji.json'
output_path = '../../emojify/src/main/assets/emoticons/emoji.json'
os.makedirs(os.path.dirname(output_path), exist_ok=True)

with open(output_path, 'w', encoding='utf-8') as stream:
Expand Down
3 changes: 0 additions & 3 deletions scripts/emoji_generator/emoji_generator/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,8 @@ def parse_emoji_data(data: List[Emoji]) -> List[Dict]:
result: Dict = {
"emoji": item.emoji,
"description": item.label,
"group": item.group.name if item.group is not None else None,
"subgroup": item.subgroup.name if item.subgroup is not None else None,
"tags": item.tags,
"unicode": compute_unicode(normalized_emoji),
"gender": item.gender.name if item.gender is not None else None,
"htmlDec": compute_html_dec(normalized_emoji),
"htmlHex": compute_html_hex(normalized_emoji),
"supportsFitzpatrick": len(item.skins) > 0 if item.skins is not None else None,
Expand Down

0 comments on commit f03511c

Please sign in to comment.