Skip to content

Commit d1e008b

Browse files
MeierschlumpfDashboard Icons Bot
and
Dashboard Icons Bot
authored
feat: add issue_templates for creation of icons (#935)
Co-authored-by: Dashboard Icons Bot <[email protected]>
1 parent 02aaf9b commit d1e008b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+18527
-44
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: "Add light & dark icon"
2+
description: Use this template to add a new icon to the project. Monochrome icons need both light and dark versions.
3+
title: "feat(icons): add [NAME]"
4+
labels: ["monochrome-icon"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Hello and thank you for contributing to the project! Please fill out the following information to add a new icon to the project.
10+
Once you've submitted the issue, sombody from the team will review it, before adding a label which automatically creates a pull request with the other filetypes.
11+
If you submit a PNG icon, please note, that the SVG can not be generated from it.
12+
- type: input
13+
attributes:
14+
label: Icon name
15+
description: The name has to be unique and should be kebab-case.
16+
placeholder: e.g. "icon-name"
17+
- type: textarea
18+
attributes:
19+
label: Paste light mode icon
20+
description: |
21+
Please paste the icon here. It will automatically upload it to github. This icon should be visible on a light background.
22+
- type: textarea
23+
attributes:
24+
label: Paste dark mode icon
25+
description: |
26+
Please paste the icon here. It will automatically upload it to github. This icon should be visible on a dark background.
27+
- type: dropdown
28+
attributes:
29+
label: Icon type
30+
options:
31+
- SVG
32+
- PNG
33+
- type: dropdown
34+
attributes:
35+
label: Categories
36+
multiple: true
37+
options:
38+
- Animal
39+
- Cloud
40+
- Communication
41+
- Design
42+
- Development
43+
- E-Commerce
44+
- Education
45+
- File
46+
- Finance
47+
- Food
48+
- Gaming
49+
- Hardware
50+
- Health
51+
- Location
52+
- Logistics
53+
- Media
54+
- Music
55+
- Nature
56+
- News
57+
- Organization
58+
- Search
59+
- Security
60+
- SocialMedia
61+
- Streaming
62+
- Travel
63+
- Video
64+
- type: input
65+
attributes:
66+
label: Aliases
67+
description: A comma separated list of aliases
68+
placeholder: e.g. "icon-alias, icon-alias-2"
69+
- type: textarea
70+
attributes:
71+
label: Additional information
72+
description: |
73+
Add additional informations like a link to the application.
+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: "Add normal icon"
2+
description: Use this template to add a new icon to the project. Normal icons work for both light and dark themes.
3+
title: "feat(icons): add [NAME]"
4+
labels: ["normal-icon"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Hello and thank you for contributing to the project! Please fill out the following information to add a new icon to the project.
10+
Once you've submitted the issue, sombody from the team will review it, before adding a label which automatically creates a pull request with the other filetypes.
11+
If you submit a PNG icon, please note, that the SVG can not be generated from it.
12+
- type: input
13+
attributes:
14+
label: Icon name
15+
description: The name has to be unique and should be kebab-case.
16+
placeholder: e.g. "icon-name"
17+
- type: textarea
18+
attributes:
19+
label: Paste icon
20+
description: |
21+
Please paste the icon here. It will automatically upload it to github.
22+
- type: dropdown
23+
attributes:
24+
label: Icon type
25+
options:
26+
- SVG
27+
- PNG
28+
- type: dropdown
29+
attributes:
30+
label: Categories
31+
multiple: true
32+
options:
33+
- Animal
34+
- Cloud
35+
- Communication
36+
- Design
37+
- Development
38+
- E-Commerce
39+
- Education
40+
- File
41+
- Finance
42+
- Food
43+
- Gaming
44+
- Hardware
45+
- Health
46+
- Location
47+
- Logistics
48+
- Media
49+
- Music
50+
- Nature
51+
- News
52+
- Organization
53+
- Search
54+
- Security
55+
- SocialMedia
56+
- Streaming
57+
- Travel
58+
- Video
59+
- type: input
60+
attributes:
61+
label: Aliases
62+
description: A comma separated list of aliases
63+
placeholder: e.g. "icon-alias, icon-alias-2"
64+
- type: textarea
65+
attributes:
66+
label: Additional information
67+
description: |
68+
Add additional informations like a link to the application.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: "Update light & dark icon"
2+
description: Use this template to update an existing icon. Monochrome icons need both light and dark versions.
3+
title: "feat(icons): update [NAME]"
4+
labels: ["monochrome-icon"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Hello and thank you for contributing to the project! Please fill out the following informations to update an existing icon in the project.
10+
- type: input
11+
attributes:
12+
label: Icon name
13+
description: The name has to be unique and should be kebab-case.
14+
placeholder: e.g. "icon-name"
15+
- type: textarea
16+
attributes:
17+
label: Paste light mode icon
18+
description: |
19+
Please paste the icon here. It will automatically upload it to github. This icon should be visible on a light background.
20+
- type: textarea
21+
attributes:
22+
label: Paste dark mode icon
23+
description: |
24+
Please paste the icon here. It will automatically upload it to github. This icon should be visible on a dark background.
25+
- type: dropdown
26+
attributes:
27+
label: Icon type
28+
options:
29+
- SVG
30+
- PNG
31+
- type: textarea
32+
attributes:
33+
label: Additional information
34+
description: |
35+
Add additional informations like, the reason for the update, or what has been changed.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: "Update normal icon"
2+
description: Use this template to update an existing icon. Normal icons work for both light and dark themes.
3+
title: "feat(icons): update [NAME]"
4+
labels: ["normal-icon"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Hello and thank you for contributing to the project! Please fill out the following informations to update an existing icon in the project.
10+
- type: input
11+
attributes:
12+
label: Icon name
13+
description: The name has to match the existing icon name.
14+
placeholder: e.g. "icon-name"
15+
- type: textarea
16+
attributes:
17+
label: Paste icon
18+
description: |
19+
Please paste the icon here. It will automatically upload it to github.
20+
- type: dropdown
21+
attributes:
22+
label: Icon type
23+
options:
24+
- SVG
25+
- PNG
26+
- type: textarea
27+
attributes:
28+
label: Additional information
29+
description: |
30+
Add additional informations like, the reason for the update, or what has been changed.

.github/workflows/compress_icons.yml

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: Compress Icons
22

33
on:
4-
schedule:
5-
- cron: "0 0 * * 0"
64
workflow_dispatch:
75

86
jobs:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: "[Icon] Icon addition approved"
2+
on:
3+
issues:
4+
types: [labeled]
5+
6+
jobs:
7+
add-icon:
8+
runs-on: ubuntu-latest
9+
# This condition ensures the job only runs when the 'approved' label is added and the issue title starts with 'feat(icons): add '
10+
if: |
11+
contains(github.event.issue.labels.*.name, 'approved') &&
12+
startsWith(github.event.issue.title, 'feat(icons): add ')
13+
env:
14+
ICON_TYPE: ${{ contains(github.event.issue.labels.*.name, 'normal-icon') && 'normal' || 'monochrome' }}
15+
steps:
16+
- name: Obtain token
17+
id: obtainToken
18+
uses: tibdex/github-app-token@v2
19+
with:
20+
private_key: ${{ secrets.DASHBOARD_ICONS_MANAGER_APP_PRIVATE_KEY }}
21+
app_id: ${{ vars.DASHBOARD_ICONS_MANAGER_APP_ID }}
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
env:
25+
GITHUB_TOKEN: ${{ steps.obtainToken.outputs.token }}
26+
- name: Set Up Python
27+
uses: actions/setup-python@v4
28+
with:
29+
python-version: "3.11"
30+
- name: Install Dependencies
31+
run: |
32+
pip install cairosvg pillow requests
33+
- name: Parse issue form
34+
id: parse_issue_form
35+
run: echo "ISSUE_FORM=$(python scripts/parse_issue_form.py)" >> "$GITHUB_OUTPUT"
36+
env:
37+
INPUT_ISSUE_BODY: ${{ github.event.issue.body }}
38+
- name: Create metadata file
39+
run: python scripts/generate_metadata_file.py ${{ env.ICON_TYPE }} addition
40+
env:
41+
INPUT_ISSUE_FORM: ${{ steps.parse_issue_form.outputs.ISSUE_FORM }}
42+
INPUT_ISSUE_AUTHOR_ID: ${{ github.event.issue.user.id }}
43+
INPUT_ISSUE_AUTHOR_LOGIN: ${{ github.event.issue.user.login }}
44+
- name: Generate icons
45+
run: python scripts/generate_icons.py ${{ env.ICON_TYPE }} addition
46+
env:
47+
INPUT_ISSUE_FORM: ${{ steps.parse_issue_form.outputs.ISSUE_FORM }}
48+
- name: Extract icon name
49+
id: extract_icon_name
50+
run: echo "ICON_NAME=$(python scripts/print_icon_name.py ${{ env.ICON_TYPE }} addition)" >> "$GITHUB_OUTPUT"
51+
env:
52+
INPUT_ISSUE_FORM: ${{ steps.parse_issue_form.outputs.ISSUE_FORM }}
53+
- name: Commit changes
54+
run: |
55+
git config --global user.email "193821040+dashboard-icons-manager[bot]@users.noreply.github.com"
56+
git config --global user.name "Dashboard Icons Manager"
57+
git add .
58+
git commit -m "feat(icons): add ${{ steps.extract_icon_name.outputs.ICON_NAME }}"
59+
60+
- name: Create Pull Request
61+
uses: peter-evans/create-pull-request@v7
62+
with:
63+
token: ${{ steps.obtainToken.outputs.token }}
64+
branch: icons/add-${{steps.extract_icon_name.outputs.ICON_NAME}}
65+
base: main
66+
title: "feat(icons): add ${{steps.extract_icon_name.outputs.ICON_NAME}}"
67+
delete-branch: true
68+
body: |
69+
This PR adds the icon ${{steps.extract_icon_name.outputs.ICON_NAME}} added in #${{github.event.issue.number}} to the project.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: "[Icon] Icon update approved"
2+
on:
3+
issues:
4+
types: [labeled]
5+
6+
jobs:
7+
update-icon:
8+
runs-on: ubuntu-latest
9+
# This condition ensures the job only runs when the 'approved' label is updated and the issue title starts with 'feat(icons): update '
10+
if: |
11+
contains(github.event.issue.labels.*.name, 'approved') &&
12+
startsWith(github.event.issue.title, 'feat(icons): update ')
13+
env:
14+
ICON_TYPE: ${{ contains(github.event.issue.labels.*.name, 'normal-icon') && 'normal' || 'monochrome' }}
15+
steps:
16+
- name: Obtain token
17+
id: obtainToken
18+
uses: tibdex/github-app-token@v2
19+
with:
20+
private_key: ${{ secrets.DASHBOARD_ICONS_MANAGER_APP_PRIVATE_KEY }}
21+
app_id: ${{ vars.DASHBOARD_ICONS_MANAGER_APP_ID }}
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
env:
25+
GITHUB_TOKEN: ${{ steps.obtainToken.outputs.token }}
26+
- name: Set Up Python
27+
uses: actions/setup-python@v4
28+
with:
29+
python-version: "3.11"
30+
- name: Install Dependencies
31+
run: |
32+
pip install cairosvg pillow requests
33+
- name: Parse issue form
34+
id: parse_issue_form
35+
run: echo "ISSUE_FORM=$(python scripts/parse_issue_form.py)" >> "$GITHUB_OUTPUT"
36+
env:
37+
INPUT_ISSUE_BODY: ${{ github.event.issue.body }}
38+
- name: Update metadata file
39+
run: python scripts/generate_metadata_file.py ${{ env.ICON_TYPE }} update
40+
env:
41+
INPUT_ISSUE_FORM: ${{ steps.parse_issue_form.outputs.ISSUE_FORM }}
42+
INPUT_ISSUE_AUTHOR_ID: ${{ github.event.issue.user.id }}
43+
INPUT_ISSUE_AUTHOR_LOGIN: ${{ github.event.issue.user.login }}
44+
- name: Generate icons
45+
run: python scripts/generate_icons.py ${{ env.ICON_TYPE }} update
46+
env:
47+
INPUT_ISSUE_FORM: ${{ steps.parse_issue_form.outputs.ISSUE_FORM }}
48+
- name: Extract icon name
49+
id: extract_icon_name
50+
run: echo "ICON_NAME=$(python scripts/print_icon_name.py ${{ env.ICON_TYPE }} update)" >> "$GITHUB_OUTPUT"
51+
env:
52+
INPUT_ISSUE_FORM: ${{ steps.parse_issue_form.outputs.ISSUE_FORM }}
53+
- name: Commit changes
54+
run: |
55+
git config --global user.email "193821040+dashboard-icons-manager[bot]@users.noreply.github.com"
56+
git config --global user.name "Dashboard Icons Manager"
57+
git add .
58+
git commit -m "feat(icons): update ${{ steps.extract_icon_name.outputs.ICON_NAME }}"
59+
60+
- name: Create Pull Request
61+
uses: peter-evans/create-pull-request@v7
62+
with:
63+
token: ${{ steps.obtainToken.outputs.token }}
64+
branch: icons/update-${{steps.extract_icon_name.outputs.ICON_NAME}}
65+
base: main
66+
title: "feat(icons): update ${{steps.extract_icon_name.outputs.ICON_NAME}}"
67+
delete-branch: true
68+
body: |
69+
This PR updates the icon ${{steps.extract_icon_name.outputs.ICON_NAME}} like requested in #${{github.event.issue.number}} to the project.

meta/apple.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
}
1111
},
1212
"colors": {
13-
"dark": "apple",
14-
"light": "apple-light"
13+
"light": "apple",
14+
"dark": "apple-light"
1515
}
16-
}
16+
}

0 commit comments

Comments
 (0)