-
-
Notifications
You must be signed in to change notification settings - Fork 12
66 lines (59 loc) · 2.36 KB
/
python-cd.yml
File metadata and controls
66 lines (59 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Python CD
on:
workflow_dispatch:
schedule:
- cron: "0 2 * * 5"
env:
PYTHONUNBUFFERED: 1
WORKSPACE: ./scripts/emoji_generator
jobs:
update-emoji-json:
name: Update emoji.json
runs-on: ubuntu-latest
env:
VERSION: ""
RELEASE_URL: ""
defaults:
run:
working-directory: scripts/emoji_generator
steps:
- uses: actions/create-github-app-token@v3
id: app-token
with:
client-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Checkout repository
uses: actions/checkout@v6
- name: Common setup
uses: ./.github/actions/python
with:
workspace: ${{ env.WORKSPACE }}
- name: Fetch Latest Emojibase Version
id: fetch_version
run: |
RELEASE_INFO=$(curl -s https://api.github.com/repos/milesj/emojibase/releases/latest)
LATEST_RELEASE=$(echo "$RELEASE_INFO" | jq -r '.tag_name')
RELEASE_URL=$(echo "$RELEASE_INFO" | jq -r '.html_url')
echo "VERSION=$(echo \"$LATEST_RELEASE\" | grep -oP '(?<=emojibase-data@)\d+\.\d+\.\d+')" >> $GITHUB_ENV
echo "RELEASE_URL=$RELEASE_URL" >> $GITHUB_ENV
# This step should preferably check if the version of emojibase-data exists on unicode.org
# and only run this step if it does exist. Otherwise we should stop the workflow here.
- name: Download emoji-test data
run: |
curl -s -o ../../emojify/src/test/resources/io/wax911/emojify/core/emoji-test.txt https://unicode.org/Public/emoji/latest/emoji-test.txt
- name: Run Emoji Update Script
env:
EMOJI_VERSION: ${{ env.VERSION }}
run: poetry run emoji-generator
- name: Push Changes and Create PR
uses: peter-evans/create-pull-request@v8
with:
commit-message: "chore(deps): update emoji.json to emojibase-data@${{ env.VERSION }}"
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 <noreply@github.com>
delete-branch: true
token: ${{ steps.app-token.outputs.token }}