mirror of
https://github.com/konpa/devicon.git
synced 2025-09-01 02:22:19 +02:00
Feature: Peek and Build-Bot Upgrade (#806)
* Refactored peek script into a class * Post-peek workflow now upload the new screenshots * Refactored BuildSeleniumRunner into a class * Updated build_icons.yml to reflect new changes * Fixed issue with building icons that were already in the app * Build script will take screenshot of new icons * Update post peek yaml message * Added alerts * Peek script now check for strokes in icons * Updated post_peek's strokes in svgs message * Updated post_peek script's message * Updated post_peek's message * Refactored get_release_message into icomoon_build * Change devicon.css name to devicon-base.css * Updated post_peek message * Added update icon as a valid PR title for bot-peek * Add \n char to SVG after it gets optimized * Fixed error with 'update icon' regex * Build script now batch issues when upload SVG * Addressed build-bot's screenshot order * Apply suggestions from code review Co-authored-by: David Leal <halfpacho@gmail.com> Co-authored-by: David Leal <halfpacho@gmail.com>
This commit is contained in:
36
.github/workflows/build_icons.yml
vendored
36
.github/workflows/build_icons.yml
vendored
@@ -42,27 +42,45 @@ jobs:
|
||||
uses: devicons/public-upload-to-imgur@v2.2.2
|
||||
if: success()
|
||||
with:
|
||||
path: ./new_icons.png
|
||||
# will have "new_icons.png" and "new_svgs.png"
|
||||
# in that order (cause sorted alphabetically)
|
||||
path: ./screenshots/*.png
|
||||
client_id: ${{secrets.IMGUR_CLIENT_ID}}
|
||||
|
||||
- name: Get the release message from file
|
||||
id: release_message_step
|
||||
uses: juliangruber/read-file-action@v1.0.0
|
||||
with:
|
||||
# taken from icomoon_build.py's get_release_message()
|
||||
path: ./release_message.txt
|
||||
|
||||
- name: Create Pull Request
|
||||
if: success()
|
||||
uses: peter-evans/create-pull-request@v3
|
||||
env:
|
||||
MESSAGE: |
|
||||
What's up!
|
||||
Hello,
|
||||
|
||||
I'm Devicon's Build Bot and I just built some new font files and devicon.min.css file.
|
||||
|
||||
Here are all the files that were built into icons (the new ones are those without highlight):
|
||||
Here are all the **SVGs** that were uploaded (the new ones are those without highlight):
|
||||
|
||||

|
||||
{0}
|
||||
|
||||
Here is what they look like as icons:
|
||||
|
||||
{1}
|
||||
|
||||
The devicon.min.css file contains:
|
||||
-The icon content
|
||||
-The aliases
|
||||
-The colored classes
|
||||
|
||||
I also compiled a list of new features and icons that were added since last release.
|
||||
```
|
||||
{2}
|
||||
```
|
||||
|
||||
More information can be found in the GitHub Action logs for this workflow.
|
||||
|
||||
Adios,
|
||||
@@ -71,5 +89,13 @@ jobs:
|
||||
branch: 'bot/build-result'
|
||||
commit-message: 'Built new icons, icomoon.json and devicon.css'
|
||||
title: 'bot:build new icons, icomoon.json and devicon.css'
|
||||
body: ${{ format(env.MESSAGE, fromJSON(steps.imgur_step.outputs.imgur_urls)[0] ) }}
|
||||
body: >
|
||||
${{
|
||||
format(
|
||||
env.MESSAGE,
|
||||
fromJSON(steps.imgur_step.outputs.markdown_urls)[1],
|
||||
fromJSON(steps.imgur_step.outputs.markdown_urls)[0],
|
||||
steps.release_message_step.outputs.content
|
||||
)
|
||||
}}
|
||||
delete-branch: true
|
||||
|
23
.github/workflows/get_release_message.yml
vendored
23
.github/workflows/get_release_message.yml
vendored
@@ -1,23 +0,0 @@
|
||||
name: Get Release Message
|
||||
on: workflow_dispatch
|
||||
jobs:
|
||||
build:
|
||||
name: Get features since last release
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Python v3.8
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.8
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r ./.github/scripts/requirements.txt
|
||||
|
||||
- name: Run the get_release_message.py
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: python ./.github/scripts/get_release_message.py $GITHUB_TOKEN
|
79
.github/workflows/post_peek_screenshot.yml
vendored
79
.github/workflows/post_peek_screenshot.yml
vendored
@@ -39,6 +39,22 @@ jobs:
|
||||
with:
|
||||
path: ./err_messages/err_messages.txt
|
||||
|
||||
# using this trigger allowed us to access secrets
|
||||
- name: Upload screenshot of the SVGs gotten from the artifacts
|
||||
id: svgs_overview_img_step
|
||||
if: env.PEEK_STATUS == 'success' && success()
|
||||
uses: devicons/public-upload-to-imgur@v2.2.2
|
||||
with:
|
||||
path: ./screenshots/new_svgs.png
|
||||
client_id: ${{secrets.IMGUR_CLIENT_ID}}
|
||||
|
||||
- name: Upload zoomed in screenshot of the SVGs gotten from the artifacts
|
||||
id: svgs_detailed_img_step
|
||||
uses: devicons/public-upload-to-imgur@v2.2.2
|
||||
if: env.PEEK_STATUS == 'success' && success()
|
||||
with:
|
||||
path: ./screenshots/new_svg_*.png
|
||||
client_id: ${{secrets.IMGUR_CLIENT_ID}}
|
||||
|
||||
- name: Upload screenshot of the newly made icons gotten from the artifacts
|
||||
id: icons_overview_img_step
|
||||
@@ -53,7 +69,7 @@ jobs:
|
||||
uses: devicons/public-upload-to-imgur@v2.2.2
|
||||
if: env.PEEK_STATUS == 'success' && success()
|
||||
with:
|
||||
path: ./screenshots/screenshot_*.png
|
||||
path: ./screenshots/new_icon_*.png
|
||||
client_id: ${{secrets.IMGUR_CLIENT_ID}}
|
||||
|
||||
- name: Comment on the PR about the result - Success
|
||||
@@ -64,19 +80,32 @@ jobs:
|
||||
Hi there,
|
||||
|
||||
I'm Devicons' Peek Bot and I just peeked at the icons that you wanted to add using [icomoon.io](https://icomoon.io/app/#/select).
|
||||
Here is the result below (top left):
|
||||
|
||||
{0}
|
||||
|
||||
Here are the zoomed-in screenshots of the added icons:
|
||||
Here are the SVGs as intepreted by Icomoon when we upload the files:
|
||||
{1}
|
||||
|
||||
Here are the zoomed-in screenshots of the added icons as **SVGs**. This is how Icomoon intepret the uploaded SVGs:
|
||||
{2}
|
||||
|
||||
Here are the icons that will be generated by Icomoon:
|
||||
{3}
|
||||
|
||||
Here are the zoomed-in screenshots of the added icons as **icons**. This is what the font will look like:
|
||||
{4}
|
||||
|
||||
You can click on the pictures and zoom on them if needed.
|
||||
|
||||
The maintainers will now check for:
|
||||
1. The number of Glyphs matches the number of SVGs that were selected.
|
||||
2. The icons (second group of pictures) look the same as the SVGs (first group of pictures).
|
||||
3. The icons are of high quality (legible, matches the official logo, etc.)
|
||||
|
||||
In case of font issues, it might be caused by Icomoon not accepting strokes in the SVGs. Check this [doc](https://icomoon.io/#faq/importing) for more details and fix the issues as instructed by Icomoon and update this PR once you are done.
|
||||
|
||||
Thank you for contributing to Devicon! I hope that your icons are accepted into the repository.
|
||||
|
||||
Note: If the images don't show up, it's probably because it has been autodeleted by Imgur after 6 months due to our API choice.
|
||||
|
||||
**The maintainers will now take a look at it and decide whether to merge your PR.**
|
||||
|
||||
Thank you for contributing to Devicon! I hope everything works out and your icons are accepted into the repo.
|
||||
|
||||
Cheers,
|
||||
Peek Bot :blush:
|
||||
with:
|
||||
@@ -84,12 +113,19 @@ jobs:
|
||||
issue_number: ${{ steps.pr_num_reader.outputs.content }}
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
body: >
|
||||
${{ format(env.MESSAGE,
|
||||
fromJSON(steps.icons_overview_img_step.outputs.markdown_urls)[0],
|
||||
join(fromJSON(steps.icons_detailed_img_step.outputs.markdown_urls), '')) }}
|
||||
${{
|
||||
format(
|
||||
env.MESSAGE,
|
||||
steps.err_message_reader.outputs.content,
|
||||
fromJSON(steps.svgs_overview_img_step.outputs.markdown_urls)[0],
|
||||
join(fromJSON(steps.svgs_detailed_img_step.outputs.markdown_urls), ' '),
|
||||
fromJSON(steps.icons_overview_img_step.outputs.markdown_urls)[0],
|
||||
join(fromJSON(steps.icons_detailed_img_step.outputs.markdown_urls), ' ')
|
||||
)
|
||||
}}
|
||||
|
||||
- name: Comment on the PR about the result - Failure
|
||||
if: failure() || env.PEEK_STATUS == 'failure'
|
||||
if: env.PEEK_STATUS == 'failure'
|
||||
uses: jungwinter/comment@v1 # let us comment on a specific PR
|
||||
env:
|
||||
MESSAGE: |
|
||||
@@ -116,3 +152,20 @@ jobs:
|
||||
issue_number: ${{ steps.pr_num_reader.outputs.content }}
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
body: ${{ format(env.MESSAGE, steps.err_message_reader.outputs.content) }}
|
||||
- name: Comment on the PR about the result - Failure
|
||||
if: failure()
|
||||
uses: jungwinter/comment@v1 # let us comment on a specific PR
|
||||
env:
|
||||
MESSAGE: |
|
||||
Hi there,
|
||||
|
||||
I'm Devicons' Peek Bot and we've ran into a problem with the `post_peek_screenshot` workflow.
|
||||
The maintainers will take a look and fix the issue. Please wait for further instructions.
|
||||
|
||||
Thank you,
|
||||
Peek Bot :relaxed:
|
||||
with:
|
||||
type: create
|
||||
issue_number: ${{ steps.pr_num_reader.outputs.content }}
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
body: env.MESSAGE
|
||||
|
Reference in New Issue
Block a user