[Add font]: #48
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Download and Upload Files from Issue | |
on: | |
issues: | |
types: [opened] | |
jobs: | |
download-and-upload: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: clone environment | |
run: | | |
git clone https://github.com/404-novel-project/font_tables_lib | |
- name: Extract download link from issue and Download font | |
id: extract-and-download-links | |
run: | | |
cd font_tables_lib | |
ISSUE_BODY="${{ github.event.issue.body }}" | |
python download.py "$ISSUE_BODY" | |
- name: process font | |
run: | | |
cd font_tables_lib | |
python -m pip install --upgrade pip | |
python -m pip install --upgrade Pillow | |
pip install -r requirements.txt | |
python main.py | |
mv gen/* ../ | |
cd ../ | |
rm -rf font_tables_lib | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git pull | |
git add * | |
git commit -m "Add downloaded file from issue #${{ github.event.issue.number }}" | |
git push | |
- name: Comment the issue | |
run: | | |
ISSUE_NUMBER="${{ github.event.issue.number }}" | |
COMMENT_BODY="字体已成功处理,因缓存问题可能需要一段时间后才能生效" | |
gh issue comment $ISSUE_NUMBER --body "$COMMENT_BODY" | |
env: | |
GH_TOKEN: ${{ github.token }} | |
close-issue: | |
runs-on: ubuntu-latest | |
if: ${{ always() }} | |
needs: download-and-upload | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Comment and close the issue | |
run: | | |
ISSUE_NUMBER="${{ github.event.issue.number }}" | |
COMMENT_BODY="此issue已处理完毕,如果你没有看到成功处理的信息,则可能出现了错误,请等待修复" | |
gh issue comment $ISSUE_NUMBER --body "$COMMENT_BODY" | |
gh issue close $ISSUE_NUMBER | |
env: | |
GH_TOKEN: ${{ github.token }} |