Skip to content

Commit

Permalink
Merge pull request #560 from devicons/develop
Browse files Browse the repository at this point in the history
Release v2.11.0
  • Loading branch information
Thomas-Boi authored Apr 10, 2021
2 parents 2809b56 + a23a1cd commit c7d326b
Show file tree
Hide file tree
Showing 62 changed files with 1,048 additions and 78 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/icomoon_peek.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def main():
if len(filtered_icons) == 0:
message = "No icons found matching the icon name in the PR's title.\n" \
"Ensure that a new icon entry is added in the devicon.json and the PR title matches the convention here: \n" \
"https://github.com/devicons/devicon/blob/master/CONTRIBUTING.md#overview.\n" \
"https://github.com/devicons/devicon/blob/master/CONTRIBUTING.md#overview\n" \
"Ending script...\n"
sys.exit(message)

Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/build_icons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
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:
Here are all the files that were built into icons (the new ones are those without highlight):
![Files Built]({0})
Expand All @@ -65,8 +65,7 @@ jobs:
Adios,
Build Bot :sunglasses:
with:
branch: 'master-build-result'
base: 'master'
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] ) }}
Expand Down
31 changes: 17 additions & 14 deletions .github/workflows/peek_icons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ on:
pull_request:
types: [labeled]
jobs:
build:
peek:
# four outcomes: successful check and upload,
# unsuccessful check (fail due to user),
# fail due to system, skipped
name: Peek Icons
if: github.event.label.name == 'bot:peek'
runs-on: windows-2019
Expand All @@ -20,6 +23,18 @@ jobs:
python -m pip install --upgrade pip
pip install -r ./.github/scripts/requirements.txt
- name: Save the PR number in an artifact
shell: bash
env:
PR_NUM: ${{ github.event.number }}
run: echo $PR_NUM > pr_num.txt

- name: Upload the PR number
uses: actions/upload-artifact@v2
with:
name: pr_num
path: ./pr_num.txt

- name: Run icomoon_peek.py
env:
PR_TITLE: ${{ github.event.pull_request.title }}
Expand All @@ -36,21 +51,9 @@ jobs:
name: screenshots
path: ./screenshots/*.png

- name: Save the pr num in an artifact
shell: bash
env:
PR_NUM: ${{ github.event.number }}
run: echo $PR_NUM > pr_num.txt

- name: Upload the pr num
uses: actions/upload-artifact@v2
with:
name: pr_num
path: ./pr_num.txt

- name: Upload geckodriver.log for debugging purposes
uses: actions/upload-artifact@v2
if: failure()
with:
name: geckodriver-log
path: ./geckodriver.log
path: ./geckodriver.log
33 changes: 19 additions & 14 deletions .github/workflows/post_check_svgs_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,21 @@ jobs:
with:
path: ./svg_err_messages/svg_err_messages.txt

- 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 == '1'
env:
MESSAGE: |
Hi!
I'm Devicons' SVG-Checker Bot and everything looks great. Good job!
# - 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 == '1'
# env:
# MESSAGE: |
# Hi!
# I'm Devicons' SVG-Checker Bot and everything looks great. Good job!

Have a nice day,
SVG-Checker Bot :grin:
with:
type: create
issue_number: ${{ steps.pr_num_reader.outputs.content }}
token: ${{ secrets.GITHUB_TOKEN }}
body: ${{ env.MESSAGE }}
# Have a nice day,
# SVG-Checker Bot :grin:
# with:
# type: create
# issue_number: ${{ steps.pr_num_reader.outputs.content }}
# token: ${{ secrets.GITHUB_TOKEN }}
# body: ${{ env.MESSAGE }}

- name: Comment on the PR about the result - SVG Error
uses: jungwinter/comment@v1 # let us comment on a specific PR
Expand Down Expand Up @@ -79,6 +79,11 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
body: ${{ format(env.MESSAGE, steps.err_message_reader.outputs.content) }}

# if we posted error messages before, we fail this entire workflow
- name: Fail workflow is there is an error.
uses: cutenode/[email protected]
if: success() && (steps.err_message_reader.outputs.content != '0' && steps.err_message_reader.outputs.content != '1')

- name: Comment on the PR about the result - Failure
uses: jungwinter/comment@v1 # let us comment on a specific PR
if: failure()
Expand Down
31 changes: 19 additions & 12 deletions .github/workflows/post_peek_screenshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@ jobs:
post_screenshots_in_comment:
name: Post the screenshot
runs-on: ubuntu-18.04
if: github.event.action == 'completed' && github.event.workflow_run.conclusion != 'skipped'
env:
# three possible values: 'skipped', 'success', 'failure'
# have to print github.event to console to see these values
# note: can't use this env variable up in the if statement above for some reason.
# I don't think it's an ordering issue cause it seems 'if' is auto evaluate first
PEEK_STATUS: ${{ github.event.workflow_run.conclusion }}
steps:
- name: Check if the trigger run worked. If not, fail the current run.
if: github.event.workflow_run.conclusion != 'success'
uses: cutenode/[email protected]
- name: Check state of last run
run: echo $PEEK_STATUS

- name: Download workflow artifact
uses: dawidd6/[email protected]
Expand All @@ -21,14 +27,14 @@ jobs:
run_id: ${{ github.event.workflow_run.id }}

- name: Read the pr_num file
if: success()
id: pr_num_reader
uses: juliangruber/[email protected]
with:
path: ./pr_num/pr_num.txt

- name: Upload screenshot of the newly made icons gotten from the artifacts
id: icons_overview_img_step
if: env.PEEK_STATUS == 'success' && success()
uses: devicons/[email protected]
with:
path: ./screenshots/new_icons.png
Expand All @@ -37,22 +43,20 @@ jobs:
- name: Upload zoomed in screenshot of the newly made icons gotten from the artifacts
id: icons_detailed_img_step
uses: devicons/[email protected]
if: success()
if: env.PEEK_STATUS == 'success' && success()
with:
path: ./screenshots/screenshot_*.png
client_id: ${{secrets.IMGUR_CLIENT_ID}}

- name: Comment on the PR about the result - Success
uses: jungwinter/comment@v1 # let us comment on a specific PR
if: success()
if: env.PEEK_STATUS == 'success' && 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), '') }}
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:
Here is the result below (top right):
{0}
Expand All @@ -71,10 +75,13 @@ jobs:
type: create
issue_number: ${{ steps.pr_num_reader.outputs.content }}
token: ${{ secrets.GITHUB_TOKEN }}
body: ${{format(env.MESSAGE, env.OVERVIEW_IMG_MARKDOWN, env.DETAILED_IMGS_MARKDOWN)}}
body: >
${{ format(env.MESSAGE,
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() || cancelled()
if: failure() || env.PEEK_STATUS == 'failure'
uses: jungwinter/comment@v1 # let us comment on a specific PR
env:
MESSAGE: |
Expand All @@ -88,7 +95,7 @@ jobs:
- Your icon information has been added to the `devicon.json` as seen [here](https://github.com/devicons/devicon/blob/master/CONTRIBUTING.md#updateDevicon)
- Your PR title follows the format seen [here](https://github.com/devicons/devicon/blob/master/CONTRIBUTING.md#overview)
Once everything is fixed, I will try. If I still fail (sorry!), the maintainers will investigate further.
I will retry once everything is fixed. If I still fail (sorry!) or there are other erros, the maintainers will investigate.
Best of luck,
Peek Bot :relaxed:
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 'Stale'
on:
schedule:
- cron: '30 1 * * *'

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@main
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-pr-message: 'Hello there,
we noticed that this PR has been inactive for a while now. If there are any changes which are suitable for our repository,
we would love to have it. It would be great if you can continue with this PR, but if you cannot, we might fork your changes and merge the changes ourselves.
Since GitHub tracks contributions by commits, you will still be credited.
Let us know what you think 😃'
stale-pr-label: 'stale'
days-before-pr-stale: 30
days-before-pr-close: -1
59 changes: 51 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<h1>Contributing to Devicon</h1>
<p>
First of all, thanks for taking the time to contribute! This project can only grow and live by your countless contributions. To keep this project maintable we developed some guidelines for contributions.
First of all, thanks for taking the time to contribute! This project can only grow and live by your countless contributions. To keep this project maintainable, we have developed some guidelines for our contributors.
</p>

<h2>Table of Content</h2>
Expand All @@ -15,20 +15,23 @@ First of all, thanks for taking the time to contribute! This project can only gr
<li><a href="#requestingIcon">Requesting An Icon</a></li>
<li><a href="#teams">Maintainer/Reviewer/Teams</a></li>
<li><a href="#buildScript">Regarding the Build Script</a></li>
<li><a href="#discordServer">Discord server</a></li>
<li><a href="#release">Release strategy, conventions, preparation and execution</a></li>
</ul>

<hr>
<h2 id="terms">Terms</h2>
<p>Here are some terms that we will use in this repo: </p>
<ol>
<li>"Icon" refers to the set of svgs/icons of a technology/tool. Ex: We might refer to the React svgs and React icons as the React Icon</li>
<li>"SVG/<code>.svg</code>" refers to the <code>svg</code> versions of the Icons.</li>
<li>"icons" (lowercase) refers to the font icon versions of the Icons.</li>
<li>"Technology" is used to describe a software, libraries, tool, etc...</li>
<li>"Icon" refers to the svgs and icons version of a technology as a whole.</li>
<li>"SVG/<code>svg</code>" refers to the <code>svg</code> versions of the Icons.</li>
<li>"icon" (lowercase) refers specficially to the font icon versions of the Icons.</li>
</ol>

<hr>
<h2 id="overview">Overview on Submitting Icons</h2>
<p>Here is an overview of what you have to do to submit your icons to the repo.</p>
<p>Here is what you have to do to submit your icons to the repo.</p>
<ol>
<li>Create the svgs for each <a href="#versionNaming"> svg versions </a> that you have</li>
<li>Put the svgs of each Icon into its own folders in <code>/icons</code> </li>
Expand All @@ -43,6 +46,13 @@ First of all, thanks for taking the time to contribute! This project can only gr

<hr>
<h2 id='versionNaming'>Versions and Naming Conventions</h2>
<p>For the technology name, make the file and folder name lowercase and concatenate them. For example:</p>
<ul>
<li>AngularJS becomes <code>angularjs</code> or just <code>angular</code></li>
<li>Amazon Web Services becomes <code>amazonwebservices</code></li>
<li>Microsoft SQL Server becomes <code>microsoftsqlserver</code></li>
</ul>

<p>Each icon/svg can come in different versions. So far, we have:</p>
<ul>
<li><b>original</b>: the original logo. Can contain multiple colors. <a href="https://github.com/devicons/devicon/blob/master/icons/amazonwebservices/amazonwebservices-original.svg"> Example </a> </li>
Expand All @@ -65,7 +75,6 @@ First of all, thanks for taking the time to contribute! This project can only gr
</li>
<li>
Some icons are really simple (ex. Apple), so the original version can be used as the plain version and as the icon font. In this case, you'll only need to make one of the version (either "original" or "plain"). You can then add an alias in the <code>devicon.json</code> so they can be found with either the "original" or "plain" naming convention. Note: this only applies to font icon versions only, not the SVG versions.

</li>
</ul>

Expand All @@ -74,15 +83,15 @@ First of all, thanks for taking the time to contribute! This project can only gr
<p>Before you submit your logos/svgs, please ensure that they meet the following standard:</p>
<ul>
<li>The background must be transparent.</li>
<li>The svg name follows this convention: <code>(Icon name)-(original|plain|line)(-wordmark?).</code></li>
<li>The svg name follows this convention: <code>(Technology name)-(original|plain|line)(-wordmark?).</code></li>
<li>The <b>plain</b> and <b>line</b> versions (with or without wordmark) need to stay as simple as possible. They must have only one color and the paths are united. We will strip the color when turning it into icons so they can have any color.
</li>
<li>Optimize/compress your SVGs. You can use a service like <a href="https://compressor.io/">compressor</a> or <a href="https://petercollingridge.appspot.com/svg-editor">SVG Editor</a>.</li>
<li>The icon's strokes and texts must be fills. This is to satisfy our conversion website's <a href="https://icomoon.io/#docs/stroke-to-fill">requirements.</a></li>
<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>
<li>The naming convention for the svg file is the following: <code>(Technology name)-(original|plain|line)(-wordmark?).</code></li>
</ul>

<hr>
Expand Down Expand Up @@ -299,3 +308,37 @@ As an example, let's assume you have created the svgs for Redhat and Amazon Web
<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>

<h2 id="discordServer">Discord server</h2>
<p>
We are running a Discord server. You can go here to talk, discuss, and more with the maintainers and other people, too. Here's the invitation: https://discord.gg/hScy8KWACQ. If you don't have a GitHub account but want to suggest ideas or new icons, you can do that here in our Discord channel.
<b>Note that the Discord server is unofficial, and Devicons is still being maintained via GitHub.</b>
</p>

<h2 id='release'>Release strategy, conventions, preparation and execution</h2>
<h5>Release strategy</h5>
<p>Devicon does not follow a strict release plan. A new release is depended on current amount of contributions, required bugfixes/patches and will be discussed by the team of maintainers.</p>
<p>Generally speaking: A new release will be published when new icons are added or a bug was fixed. When it's predictable that multiple icons are added in a foreseeable amount of time they are usually wrapped together.</p>
<h5>Conventions</h5>
<p>The version naming follows the rules of <a href="https://semver.org/">Semantic Versioning</a>. Given a version number MAJOR.MINOR.PATCH, increment the:</p>
<ul>
<li>MAJOR version when you make incompatible API changes,</li>
<li>MINOR version when you add functionality <b>(like a new icon)</b> in a backwards compatible manner, and</li>
<li>PATCH version when you make backwards compatible bug fixes.</li>
</ul>

<h5>Release preparation and execution</h5>
<ol>
<li>Define the next release version number based on the conventions</li>
<li>Checkout <code>development</code> as <code>draft-release</code> branch</li>
<li>Bump the package version using <code>npm version v<i>MAJOR</i>.<i>MINOR</i>.<i>PATCH</i> -m "bump npm version to v<i>MAJOR</i>.<i>MINOR</i>.<i>PATCH</i>"</code> (see <code><a href="https://github.com/devicons/devicon/pull/497">#487</a></code>)</li>
<li>Push the branch <code>draft-release</code></li>
<li>Manually trigger the workflow <code><a href="https://github.com/devicons/devicon/actions/workflows/build_icons.yml">build_icons.yml</a></code> (which has a <code>workflow_dispatch</code> event trigger) and select the branch <code>draft-release</code> as target branch. This will build a font version of all icons using icomoon and automatically creates a pull request to merge the build result back into <code>draft-release</code></li>
<li>Review and approve the auto-create pull request created by the action of the step above</li>
<li>Create a pull request towards <code>development</code>. Mention the release number in the pull request title and add information about all new icons, fixes, features and enhancements in the description of the pull request. Take the commits as a guideline. It's also a good idea to mention and thank all contributions who participated in the release (take description of <code><a href="https://github.com/devicons/devicon/pull/504">#504</a></code> as an example).</li>
<li>Wait for review and approval of the pull request (<b>DON'T</b> perform a squash-merge)</li>
<li>Once merged create a pull request with BASE <code>master</code> and HEAD <code>development</code>. Copy the description of the earlier pull request.</li>
<li>Since it was already approved in the 'development' stage a maintainer is allowed to merge it (<b>DON'T</b> perform a squash-merge).</li>
<li>Create a <a href="https://github.com/devicons/devicon/releases/new">new release</a> using v<i>MAJOR</i>.<i>MINOR</i>.<i>PATCH</i> as tag and release title. Use the earlier created description as description of the release.</li>
<li>Publishing the release will trigger the <a href="/.github/workflows/npm_publish.yml">npm_publish.yml</a> workflow which will execute a <code>npm publish</code> leading to a updated <a href="https://www.npmjs.com/package/devicon">npm package</a> (v<i>MAJOR</i>.<i>MINOR</i>.<i>PATCH</i>).</li>
</ol>
Loading

0 comments on commit c7d326b

Please sign in to comment.