Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v2.10.0 #504

Merged
merged 74 commits into from
Feb 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
0247aed
Create eleventy-original.svg
tylensthilaire Dec 30, 2020
3d84d90
Create eleventy-plain.svg
tylensthilaire Dec 30, 2020
94831ce
Update devicon.json
tylensthilaire Dec 30, 2020
2cb3b1a
Update eleventy-plain.svg
tylensthilaire Dec 30, 2020
6870ab4
Update eleventy-original.svg
tylensthilaire Dec 30, 2020
6c8da9e
Merge pull request #1 from devicons/develop
tylensthilaire Dec 31, 2020
9f4b672
new icon: sqlalchemy (plain, original, original-workmark)
EnisMulic Jan 1, 2021
cab2eeb
Merge remote-tracking branch 'upstream/develop' into ReallyLiri/featu…
EnisMulic Jan 2, 2021
984530b
Merge pull request #413 from tylensthilaire/master
Thomas-Boi Jan 5, 2021
a67adc2
Add font aliase for sqlalchemy
EnisMulic Jan 5, 2021
bf4050c
new icon: microsoftsqlserver (plain, plain-wordmark) (#427)
EnisMulic Jan 5, 2021
42a806e
Merge branch 'develop' into ReallyLiri/feature/icon/sqlalchemy
EnisMulic Jan 5, 2021
930f013
new icon: kubernetes (plain, plain-wordmark) (#424)
EnisMulic Jan 5, 2021
be969cd
new icon: rocksdb (plain) (#423)
EnisMulic Jan 5, 2021
5e4c2d6
new icon: googlecloud (original, original-wordmark, plain, plain-word…
EnisMulic Jan 5, 2021
504e53f
new icon: objectivec (plain) (#425)
EnisMulic Jan 5, 2021
d8c4f93
new icon uwsgi (original, plain)
EnisMulic Jan 1, 2021
95ccd33
Cleanup uwsgi icons
EnisMulic Jan 5, 2021
81c9810
Update devicon.json
EnisMulic Jan 6, 2021
cf1ea64
Add adobe XD line icon
Th1nkK1D Oct 22, 2017
2c43ee8
Add xd-plain and eps file
Th1nkK1D Oct 24, 2017
706492b
Clean up xd svg file
Th1nkK1D Jan 6, 2021
1adb2a5
Update devicon.json
Th1nkK1D Jan 6, 2021
5a45a23
new icon: firebase (plain, plain-wordmark) (#461)
EnisMulic Jan 6, 2021
5c0f823
new icon: flask (original, original-wordmark) (#463)
EnisMulic Jan 6, 2021
ad45c83
Merge pull request #462 from EnisMulic/feature/icon/uwsgi
Thomas-Boi Jan 7, 2021
1fb95b7
Update devicon.json
EnisMulic Jan 7, 2021
bc6846d
Merge pull request #426 from EnisMulic/ReallyLiri/feature/icon/sqlalc…
Thomas-Boi Jan 7, 2021
3fb2945
Fixed an error with devicon.json
Thomas-Boi Jan 7, 2021
1eedcd8
Merge pull request #468 from devicons/TB_bugFix
Thomas-Boi Jan 7, 2021
82bccb1
Added check script for the icons and fix icons with fill or viewBox i…
Thomas-Boi Jan 8, 2021
5fea573
Fix the ref issue of the checkout action and sqlalchemy (#472)
Thomas-Boi Jan 9, 2021
b7ae338
Create a monthly script that checks all svgs
Thomas-Boi Jan 8, 2021
b192292
Python now print traceback
Thomas-Boi Jan 8, 2021
c9b1934
Updated file names in check_svgs_on_pr
Thomas-Boi Jan 8, 2021
7303f17
Remove deprecated and unused svg syntax
Th1nkK1D Jan 9, 2021
6e4473a
Remove deprecated and unused svg syntax
Th1nkK1D Jan 9, 2021
c8f1503
Update svg fill, remove unused class
Th1nkK1D Jan 9, 2021
340e85e
Merge pull request #81 from Th1nkK1D/adobe-xd
Thomas-Boi Jan 9, 2021
2e49bfa
Change comment action to a new action
Thomas-Boi Jan 9, 2021
f07f379
Add guideline about squash merging
amacado Jan 10, 2021
5bcd269
Redo the workflow archs so we can comment on pr
Thomas-Boi Jan 11, 2021
d0d101a
Moved check_svgs_monthly to draft
Thomas-Boi Jan 11, 2021
3d2e655
Added working workflow file
Thomas-Boi Jan 11, 2021
c71c518
Merge pull request #480 from devicons/amacado/feature/squash-merging-…
Thomas-Boi Jan 11, 2021
4ea8446
Changed to file read action
Thomas-Boi Jan 11, 2021
7892b03
Merge pull request #481 from devicons/TB_checkSvg
Thomas-Boi Jan 12, 2021
97e6a51
new icon: appwrite (plain, original, wordmark) (#371)
eldadfux Jan 19, 2021
957d798
bot:build new icons, icomoon.json and devicon.css (#486)
github-actions[bot] Jan 19, 2021
38db4a1
Removed 'default fall back icon' from build_icons.yml
Thomas-Boi Jan 20, 2021
c8c4440
Merge pull request #487 from devicons/TB_removeFallback
Thomas-Boi Jan 20, 2021
d1803bb
new icon: r (original, plain) (#491)
jakob-r Feb 19, 2021
500730d
new icon: fsharp (original) (#495)
maltejur Feb 21, 2021
c0ca0f3
new icon: elixir (original, original-wordmark, plain, plain-wordmark)…
maltejur Feb 21, 2021
83ab256
new icon: matlab (original, plain) (#492)
Panquesito7 Feb 21, 2021
0883fca
new icon: Jupyter (original, original-wordmark, plain, plain-wordmark…
Panquesito7 Feb 21, 2021
bdf2627
automate workflow for npm publish (#497)
amacado Feb 21, 2021
fe8e365
new icon: OCaml (original, original-wordmark, plain, plain-wordmark) …
Panquesito7 Feb 21, 2021
f2145c2
redesign readme.md (#496)
amacado Feb 21, 2021
4ca37dd
Merge remote-tracking branch 'origin/master' into develop
amacado Feb 21, 2021
b627c57
Merge pull request #503 from devicons/amacado/merge/develop-master
amacado Feb 21, 2021
1058e15
new icon: AArch64 (original, plain)
Panquesito7 Feb 21, 2021
d249515
add check for directory /icons when workflow is executed (fixes #505)
amacado Feb 21, 2021
79eb453
Merge branch 'develop' into icons/aarch64
amacado Feb 21, 2021
f246192
Updated the logging of the actions
Thomas-Boi Feb 22, 2021
2249c46
Added svg check status code
Thomas-Boi Feb 22, 2021
8bc3da3
fix check svg icons workflow (#508)
amacado Feb 22, 2021
afc6a09
Merge branch 'develop' into thomas/feature/actionMessageUpdate
amacado Feb 22, 2021
1edf59e
new icon: AArch64 (original, plain) (#507)
amacado Feb 22, 2021
f8c78ca
Merge branch 'develop' into thomas/feature/actionMessageUpdate
amacado Feb 22, 2021
8250333
Updated the logging of the actions (#509)
amacado Feb 22, 2021
173d070
Remove \n from bot:peek workflow (#511)
Thomas-Boi Feb 23, 2021
ded8c89
Built new icons, icomoon.json and devicon.css (#512)
github-actions[bot] Feb 23, 2021
1671b94
bump npm package for next version 2.10.0
amacado Feb 23, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/scripts/build_assets/filehandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,20 +213,20 @@ def get_added_modified_svgs(files_added_json_path: str,
Get the svgs added and modified from the files_changed_json_path.
:param: files_added_json_path, the path to the files_added.json created by the gh-action-get-changed-files@2.1.4
:param: files_modified_json_path, the path to the files_modified.json created by the gh-action-get-changed-files@2.1.4
:return: a list of the svg file paths that were added/modified in this pr as Path.
:return: a list of the svg file paths that were added/modified in this pr as Path. It will only return icons in /icons path (see https://github.com/devicons/devicon/issues/505)
"""
files_added = get_json_file_content(files_added_json_path)
files_modified = get_json_file_content(files_modified_json_path)

svgs = []
for file in files_added:
path = Path(file)
if path.suffix.lower() == ".svg":
if path.suffix.lower() == ".svg" and path.as_posix().lower().startswith('icons/'):
svgs.append(path)

for file in files_modified:
path = Path(file)
if path.suffix.lower() == ".svg":
if path.suffix.lower() == ".svg" and path.as_posix().lower().startswith('icons/'):
svgs.append(path)

return svgs
Expand Down
57 changes: 0 additions & 57 deletions .github/scripts/build_assets/util.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
from typing import List
import xml.etree.ElementTree as et
from pathlib import Path
import os
import json
import platform
import sys
import traceback
Expand All @@ -17,59 +13,6 @@ def exit_with_err(err: Exception):
sys.exit(1)


def check_svgs(svg_file_paths: List[Path]):
"""
Check the width, height, viewBox and style of each svgs passed in.
The viewBox must be '0 0 128 128'.
If the svg has a width and height attr, ensure it's '128px'.
The style must not contain any 'fill' declarations.
If any error is found, they will be thrown.
:param: svg_file_paths, the file paths to the svg to check for.
:return: None if there no errors. If there is, return a JSON.stringified
list with the error messages in it.
"""
# batch err messages together so user can fix everything at once
err_msgs = []
for svg_path in svg_file_paths:
tree = et.parse(svg_path)
root = tree.getroot()
namespace = "{http://www.w3.org/2000/svg}"
err_msg = [f"{svg_path.name}:"]

if root.tag != f"{namespace}svg":
err_msg.append(f"-root is '{root.tag}'. Root must be an 'svg' element")

if root.get("viewBox") != "0 0 128 128":
err_msg.append("-'viewBox' is not '0 0 128 128' -> Set it or scale the file using https://www.iloveimg.com/resize-image/resize-svg")

acceptable_size = [None, "128px", "128"]
if root.get("height") not in acceptable_size:
err_msg.append("-'height' is present in svg element but is not '128' or '128px' -> Remove it or set it to '128' or '128px'")

if root.get("width") not in acceptable_size:
err_msg.append("-'width' is present in svg element but is not '128' or '128px' -> Remove it or set it to '128' or '128px'")

if root.get("style") is not None and "enable-background" in root.get("style"):
err_msg.append("-deprecated 'enable-background' in style attribute -> Remove it")

if root.get("x") is not None:
err_msg.append("-unneccessary 'x' attribute in svg element -> Remove it")

if root.get("y") is not None:
err_msg.append("-unneccessary 'y' attribute in svg element -> Remove it")

style = root.findtext(f".//{namespace}style")
if style != None and "fill" in style:
err_msg.append("-contains style declaration using 'fill' -> Replace classes with the 'fill' attribute instead")

if len(err_msg) > 1:
err_msgs.append("\n".join(err_msg))

if len(err_msgs) > 0:
return "\n\n".join(err_msgs)
return 'None'


def set_env_var(key: str, value: str, delimiter: str='~'):
"""
Set the GitHub env variable of 'key' to 'value' using
Expand Down
74 changes: 69 additions & 5 deletions .github/scripts/check_svgs_on_pr.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import sys
import time
from enum import Enum
from typing import List
import xml.etree.ElementTree as et
from pathlib import Path


# pycharm complains that build_assets is an unresolved ref
Expand All @@ -8,6 +10,14 @@
from build_assets import util


class SVG_STATUS_CODE(Enum):
"""
The status codes to check for in post_check_svgs_comment.yml
"""
NO_SVG = 0 # action: do nothing
SVG_OK = 1 # action: let user know their svgs are fine


def main():
"""
Check the quality of the svgs.
Expand All @@ -23,14 +33,68 @@ def main():

if len(svgs) == 0:
print("No SVGs to check, ending script.")
return
err_messages = SVG_STATUS_CODE.NO_SVG.value
else:
err_messages = check_svgs(svgs)

err_messages = util.check_svgs(svgs)
filehandler.write_to_file("./svg_err_messages.txt", err_messages)
filehandler.write_to_file("./svg_err_messages.txt", str(err_messages))
print("Task completed.")
except Exception as e:
util.exit_with_err(e)


def check_svgs(svg_file_paths: List[Path]):
"""
Check the width, height, viewBox and style of each svgs passed in.
The viewBox must be '0 0 128 128'.
If the svg has a width and height attr, ensure it's '128px'.
The style must not contain any 'fill' declarations.
If any error is found, they will be thrown.
:param: svg_file_paths, the file paths to the svg to check for.
:return: None if there no errors. If there is, return a JSON.stringified
list with the error messages in it.
"""
# batch err messages together so user can fix everything at once
err_msgs = []
for svg_path in svg_file_paths:
tree = et.parse(svg_path)
root = tree.getroot()
namespace = "{http://www.w3.org/2000/svg}"
err_msg = [f"{svg_path}:"]

if root.tag != f"{namespace}svg":
err_msg.append(f"-root is '{root.tag}'. Root must be an 'svg' element")

if root.get("viewBox") != "0 0 128 128":
err_msg.append("-'viewBox' is not '0 0 128 128' -> Set it or scale the file using https://www.iloveimg.com/resize-image/resize-svg")

acceptable_size = [None, "128px", "128"]
if root.get("height") not in acceptable_size:
err_msg.append("-'height' is present in svg element but is not '128' or '128px' -> Remove it or set it to '128' or '128px'")

if root.get("width") not in acceptable_size:
err_msg.append("-'width' is present in svg element but is not '128' or '128px' -> Remove it or set it to '128' or '128px'")

if root.get("style") is not None and "enable-background" in root.get("style"):
err_msg.append("-deprecated 'enable-background' in style attribute -> Remove it")

if root.get("x") is not None:
err_msg.append("-unneccessary 'x' attribute in svg element -> Remove it")

if root.get("y") is not None:
err_msg.append("-unneccessary 'y' attribute in svg element -> Remove it")

style = root.findtext(f".//{namespace}style")
if style != None and "fill" in style:
err_msg.append("-contains style declaration using 'fill' -> Replace classes with the 'fill' attribute instead")

if len(err_msg) > 1:
err_msgs.append("\n".join(err_msg))

if len(err_msgs) > 0:
return "\n\n".join(err_msgs)
return SVG_STATUS_CODE.SVG_OK.value


if __name__ == "__main__":
main()
21 changes: 21 additions & 0 deletions .github/workflows/npm_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
on:
release:
types: [released]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# "ref" specifies the branch to check out.
# "github.event.release.target_commitish" is a global variable and specifies the branch the release targeted
ref: ${{ github.event.release.target_commitish }}
- name: Use Node.js 12
uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/ # Specifies the registry, this field is required!
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTOMATION_TOKEN }}
17 changes: 8 additions & 9 deletions .github/workflows/post_check_svgs_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@ on:
types:
- completed
jobs:
post_screenshots_in_comment:
name: Post the screenshot
post_result_of_svg_check:
name: Post the result of the Check SVG Action
runs-on: ubuntu-18.04
steps:
- name: Check if the trigger run worked. If it failed, fail the current run.
if: success() && github.event.workflow_run.conclusion != 'success'
if: github.event.workflow_run.conclusion != 'success'
uses: cutenode/action-always-fail@v1.0.1

- name: Download workflow artifact
uses: dawidd6/action-download-artifact@v2.11.0
if: success()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: peek_icons.yml
Expand All @@ -36,13 +37,11 @@ jobs:

- name: Comment on the PR about the result - Success
uses: jungwinter/comment@v1 # let us comment on a specific PR
if: success() && steps.err_message_reader.outputs.content == 'None'
if: success() && steps.err_message_reader.outputs.content == '1'
env:
MESSAGE: |
Hi!
I'm Devicons' SVG-Checker Bot and I just checked all the SVGs in this branch.

Everything looks great. Good job!
I'm Devicons' SVG-Checker Bot and everything looks great. Good job!

Have a nice day,
SVG-Checker Bot :grin:
Expand All @@ -54,7 +53,7 @@ jobs:

- name: Comment on the PR about the result - SVG Error
uses: jungwinter/comment@v1 # let us comment on a specific PR
if: success() && steps.err_message_reader.outputs.content != 'None'
if: success() && (steps.err_message_reader.outputs.content != '0' || steps.err_message_reader.outputs.content != '1')
env:
MESSAGE: |
Hi!
Expand Down Expand Up @@ -82,7 +81,7 @@ jobs:

- name: Comment on the PR about the result - Failure
uses: jungwinter/comment@v1 # let us comment on a specific PR
if: failure() || cancelled()
if: failure()
env:
MESSAGE: |
Hi!
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/post_peek_screenshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ jobs:
if: success()
env:
OVERVIEW_IMG_MARKDOWN: ${{ fromJSON(steps.icons_overview_img_step.outputs.markdown_urls)[0] }}
DETAILED_IMGS_MARKDOWN: ${{ join(fromJSON(steps.icons_detailed_img_step.outputs.markdown_urls), '\n') }}
DETAILED_IMGS_MARKDOWN: ${{ join(fromJSON(steps.icons_detailed_img_step.outputs.markdown_urls), '') }}
MESSAGE: |
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:

![Peeked Icons (top left)]({0})
{0}

Here are the zoomed-in screenshots of the added icons:
{1}
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ First of all, thanks for taking the time to contribute! This project can only gr
<li>Each <code>.svg</code> file contains one version of an icon in a <code>0 0 128 128</code> viewbox. You can use a service like <a href="https://www.iloveimg.com/resize-image/resize-svg">resize-image</a> for scaling the svg.</li>
<li>The <code>svg</code> element does not need the <code>height</code> and <code>width</code> attributes. However, if you do use it, ensure their values are either <code>"128"</code> or <code>"128px"</code>. Ex: <code>height="128"</code></li>
<li>Each <code>.svg</code> must use the <code>fill</code> attribute instead of using <code>classes</code> for colors. See <a href="https://github.com/devicons/devicon/issues/407">here</a> for more details.</li>
<li>The naming convention for the svg file is the following: <code>(Icon name)-(original|plain|line)(-wordmark?).</code></li>
</ul>

<hr>
Expand Down Expand Up @@ -259,4 +260,5 @@ As an example, let's assume you have created the svgs for Redhat and Amazon Web
<li>Ensure code quality is up to standard</li>
<li>Upload svgs to <a href="https://icomoon.io/app/#/select">icomoon.io</a> and take a screenshot to check that it looks good.
<li>Comment on the PR so maintainers don't have to manually upload icon result.</li>
<li>Publishing a new release to <a href="https://www.npmjs.com/package/devicon">npm</a>; See <a href="https://github.com/devicons/devicon/issues/288">#288</a></li>
</ul>
Loading