1
0
mirror of https://github.com/konpa/devicon.git synced 2025-09-03 03:15:22 +02:00

Script upgrades and updated CONTRIBUTING.md and README.md (#576)

* Updated README and CONTRIBUTING

* Added check for devicon object when peeking

* Added PR template

* Added a script to create release messages

* Updated CONTRIBUTING about new script

* Update .github/PULL_REQUEST_TEMPLATE/new_icon.md

Co-authored-by: David Leal <halfpacho@gmail.com>

* Update .github/scripts/build_assets/arg_getters.py

Co-authored-by: David Leal <halfpacho@gmail.com>

* Update .github/workflows/get_release_message.yml

Co-authored-by: David Leal <halfpacho@gmail.com>

* Update gulpfile.js

Co-authored-by: David Leal <halfpacho@gmail.com>

* Update .github/PULL_REQUEST_TEMPLATE/new_feature.md

Co-authored-by: David Leal <halfpacho@gmail.com>

* Update .github/PULL_REQUEST_TEMPLATE/new_feature.md

Co-authored-by: David Leal <halfpacho@gmail.com>

* Added a way for peek bot to comment error

* Update CONTRIBUTING.md

Co-authored-by: Clemens Bastian <8781699+amacado@users.noreply.github.com>

* Update .github/scripts/get_release_message.py

Co-authored-by: Malte Jürgens <maltejur@web.de>

* Update .github/scripts/get_release_message.py

Co-authored-by: Malte Jürgens <maltejur@web.de>

* Update .github/PULL_REQUEST_TEMPLATE/new_feature.md

Co-authored-by: David Leal <halfpacho@gmail.com>

* Clean up and updated CONTRIBUTING

* Updated CONTRIBUTING

* Add set up steps for release message workflow

* Refactored peek workflow

* Added requests library

* Reformat devicon object error messages

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: Clemens Bastian <8781699+amacado@users.noreply.github.com>
Co-authored-by: Malte Jürgens <maltejur@web.de>
This commit is contained in:
Thomas Bui
2021-04-29 01:04:32 -07:00
committed by GitHub
parent be0f01754d
commit 41790e615b
14 changed files with 267 additions and 83 deletions

View File

@@ -40,6 +40,7 @@ First of all, thanks for taking the time to contribute! This project can only gr
<li>Include the name of the Icon in the pull request title in this format: <code>new icon: <i>Icon name</i> (<i>versions</i>)</code> </li>
<li><i>Optional</i>: Add images of the new svg(s) to the description of the pull request. This would help speed up the review process </li>
<li><i>Optional</i>: Reference the issues regarding the new icon. </li>
<li>A bot will check your SVGs. If there are any errors, please fix them as instructed.</li>
<li>Wait for a maintainer to review your changes. They will run a script to check your icons.</li>
<li>If there are no issues, they will accept your pull request and merge it using <a href="https://github.com/devicons/devicon/discussions/470">squash merging</a>. If there are any problems, they will let you know and give you a chance to fix it.</li>
</ol>
@@ -91,7 +92,6 @@ 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>(Technology name)-(original|plain|line)(-wordmark?).</code></li>
</ul>
<hr>
@@ -310,19 +310,20 @@ As an example, let's assume you have created the svgs for Redhat and Amazon Web
<hr>
<h2 id='buildScript'>The Build Script: how it works and its quirks</h2>
<p>To make adding icons easier for repo maintainers, we rely on GitHub Actions, Python, Selenium, and Gulp to automate our tasks.</p>
<p>We rely on GitHub Actions, Python, Selenium, Imgur, and Gulp to automate our tasks. Please feel free to take a look at the workflow files. The codes should be clear enough to follow along.</p>
<p>So far, the tasks in the build script are:</p>
<ul>
<li>Upload svgs to <a href="https://icomoon.io/app/#/select">icomoon.io</a> and get the icons back. For details, see <a href="https://github.com/devicons/devicon/issues/252"> the original disscussion</a>, <a href="https://github.com/devicons/devicon/pull/268">this PR that introduce the feature</a> and <a href="https://github.com/devicons/devicon/issues/300">the final changes to it.</a></li>
<li>Preview what an svg would look like as an icon using the upload svgs script (see <a href="https://github.com/devicons/devicon/pull/412">this</a></li>
<li>Build, combine, and minify CSS files. For details, see <a href="https://github.com/devicons/devicon/pull/290">this</a></li>
<li>Send screenshots to Imgur and upload it to a PR. See <a href="https://github.com/devicons/devicon/pull/398">the PR for the Imgur action</a> and <a href="https://github.com/devicons/devicon/pull/481"> the PR for uploading the pictures to a PR</a>
<li>Upload svgs to <a href="https://icomoon.io/app/#/select">icomoon.io</a> and get the icons back. For details, see <a href="https://github.com/devicons/devicon/issues/252"> the original disscussion</a>, <a href="https://github.com/devicons/devicon/pull/268">this PR that introduce the feature</a> and <a href="https://github.com/devicons/devicon/issues/300">the final changes to it.</a> Used by <b>peek-bot</b> and <b>build-bot</b>.</li>
<li>Preview what an svg would look like as an icon using the upload svgs script (see <a href="https://github.com/devicons/devicon/pull/412">this</a>). Used by <b>peek-bot</b>.</li>
<li>Build, combine, and minify CSS files. For details, see <a href="https://github.com/devicons/devicon/pull/290">this</a>. Used by <b>build-bot</b>.</li>
<li>Send screenshots to Imgur and upload it to a PR. See <a href="https://github.com/devicons/devicon/pull/398">the PR for the Imgur action</a> and <a href="https://github.com/devicons/devicon/pull/481"> the PR for uploading the pictures to a PR. Used by <b>peek-bot</b> and <b>build-bot</b>.</a>
<li>Ensure code quality is up to standard</li>
<li>Comment on the PR so maintainers don't have to manually upload icon result.</li>
<li>Comment on the PR so maintainers don't have to manually upload icon result. Used by <b>peek-bot</b> and <b>build-bot</b>.</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>
<li>Creating a list of features that was added since last release. See <a href="https://github.com/devicons/devicon/discussions/574">this discussion</a> for inception and limitations. </li>
</ul>
<p>There are some quirks and bugs that the build scripts might run into. Listed below are the common ones and their solution</p>
<p>There are some bugs that the build scripts might run into. Listed below are the common ones and their solutions</p>
<ol>
<li><b>No connection could be made because the target machine actively refused it. (os error 10061)</b>
<ul>
@@ -351,6 +352,13 @@ As an example, let's assume you have created the svgs for Redhat and Amazon Web
<li>Solution: Follow the steps laid out <a href="https://github.com/devicons/devicon/pull/554#issuecomment-816860577">here</a></li>
</ul>
</li>
<li><b>Icon created by Icomoon contains strange lines that aren't in the SVG</b>
<ul>
<li>See <a href="https://github.com/devicons/devicon/pull/532">this PR</a>'s peek result.</li>
<li>This is caused by a bug in Icomoon's parser (see <a href="https://github.com/devicons/devicon/pull/532#issuecomment-827180766">this</a>).</li>
<li>Solution: Luckily this is an extremely rare case. Try remake the svg in a different way (using different paths/shapes) and test using Icomoon.</li>
</ul>
</li>
</ol>
<h2 id="discordServer">Discord server</h2>
@@ -379,7 +387,19 @@ We are running a Discord server. You can go here to talk, discuss, and more with
<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 (like "Build preparation for release v<i>MAJOR</i>.<i>MINOR</i>.<i>PATCH</i>) 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>Create a pull request towards <code>development</code>. Mention the release number in the pull request title (like "Build preparation for release v<i>MAJOR</i>.<i>MINOR</i>.<i>PATCH</i>).
<ul>
<li>
Add information about all new icons, fixes, features and enhancements in the description of the pull request.
</li>
<li>
Take the PRs/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>
Rather than doing it manually, you can instead run <code>python ./.github/scripts/get_release_message.py $GITHUB_TOKEN</code> locally. Pass in your GitHub Personal Access Token for <code>$GITHUB_TOKEN</code> and you should see the messages. You can also use the `workflow_dispatch` trigger in the GitHub Actions tab.
</li>
</ul>
</li>
<li>Wait for review and approval of the pull request (you can 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>