mirror of
https://github.com/walkxcode/dashboard-icons.git
synced 2025-02-23 07:24:19 +01:00
ci: run compression and generation of icons.md and file-tree before pr creation
This commit is contained in:
parent
c7c4b8f16a
commit
fadaa77040
12
.github/workflows/on_icon_addition_approved.yml
vendored
12
.github/workflows/on_icon_addition_approved.yml
vendored
@ -30,6 +30,8 @@ jobs:
|
|||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: |
|
run: |
|
||||||
pip install cairosvg pillow requests
|
pip install cairosvg pillow requests
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y zopfli webp
|
||||||
- name: Parse issue form
|
- name: Parse issue form
|
||||||
id: parse_issue_form
|
id: parse_issue_form
|
||||||
run: echo "ISSUE_FORM=$(python scripts/parse_issue_form.py)" >> "$GITHUB_OUTPUT"
|
run: echo "ISSUE_FORM=$(python scripts/parse_issue_form.py)" >> "$GITHUB_OUTPUT"
|
||||||
@ -45,11 +47,21 @@ jobs:
|
|||||||
run: python scripts/generate_icons.py ${{ env.ICON_TYPE }} addition
|
run: python scripts/generate_icons.py ${{ env.ICON_TYPE }} addition
|
||||||
env:
|
env:
|
||||||
INPUT_ISSUE_FORM: ${{ steps.parse_issue_form.outputs.ISSUE_FORM }}
|
INPUT_ISSUE_FORM: ${{ steps.parse_issue_form.outputs.ISSUE_FORM }}
|
||||||
|
- name: Generate File Tree
|
||||||
|
run: python scripts/generate_file_tree.py svg png webp
|
||||||
|
- name: Generate ICONS.md
|
||||||
|
run: python scripts/generate_icons_page.py
|
||||||
- name: Extract icon name
|
- name: Extract icon name
|
||||||
id: extract_icon_name
|
id: extract_icon_name
|
||||||
run: echo "ICON_NAME=$(python scripts/print_icon_name.py ${{ env.ICON_TYPE }} addition)" >> "$GITHUB_OUTPUT"
|
run: echo "ICON_NAME=$(python scripts/print_icon_name.py ${{ env.ICON_TYPE }} addition)" >> "$GITHUB_OUTPUT"
|
||||||
env:
|
env:
|
||||||
INPUT_ISSUE_FORM: ${{ steps.parse_issue_form.outputs.ISSUE_FORM }}
|
INPUT_ISSUE_FORM: ${{ steps.parse_issue_form.outputs.ISSUE_FORM }}
|
||||||
|
- name: Compress icons
|
||||||
|
run: |
|
||||||
|
echo "Compressing PNGs..."
|
||||||
|
find png/ -iname "${{ steps.extract_icon_name.outputs.ICON_NAME }}*.png" -print0 | xargs -0 -P 4 -I{} zopflipng -y {} {}
|
||||||
|
echo "Compressing WEBPs..."
|
||||||
|
find webp/ -iname "${{ steps.extract_icon_name.outputs.ICON_NAME }}*.webp" -print0 | xargs -0 -P 4 -I{} bash -c 'cwebp -quiet -lossless "$1" -o "$1"' _ {}
|
||||||
- name: Commit changes
|
- name: Commit changes
|
||||||
run: |
|
run: |
|
||||||
git config --global user.email "193821040+dashboard-icons-manager[bot]@users.noreply.github.com"
|
git config --global user.email "193821040+dashboard-icons-manager[bot]@users.noreply.github.com"
|
||||||
|
12
.github/workflows/on_icon_update_approved.yml
vendored
12
.github/workflows/on_icon_update_approved.yml
vendored
@ -30,6 +30,8 @@ jobs:
|
|||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: |
|
run: |
|
||||||
pip install cairosvg pillow requests
|
pip install cairosvg pillow requests
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y zopfli webp
|
||||||
- name: Parse issue form
|
- name: Parse issue form
|
||||||
id: parse_issue_form
|
id: parse_issue_form
|
||||||
run: echo "ISSUE_FORM=$(python scripts/parse_issue_form.py)" >> "$GITHUB_OUTPUT"
|
run: echo "ISSUE_FORM=$(python scripts/parse_issue_form.py)" >> "$GITHUB_OUTPUT"
|
||||||
@ -45,11 +47,21 @@ jobs:
|
|||||||
run: python scripts/generate_icons.py ${{ env.ICON_TYPE }} update
|
run: python scripts/generate_icons.py ${{ env.ICON_TYPE }} update
|
||||||
env:
|
env:
|
||||||
INPUT_ISSUE_FORM: ${{ steps.parse_issue_form.outputs.ISSUE_FORM }}
|
INPUT_ISSUE_FORM: ${{ steps.parse_issue_form.outputs.ISSUE_FORM }}
|
||||||
|
- name: Generate File Tree
|
||||||
|
run: python scripts/generate_file_tree.py svg png webp
|
||||||
|
- name: Generate ICONS.md
|
||||||
|
run: python scripts/generate_icons_page.py
|
||||||
- name: Extract icon name
|
- name: Extract icon name
|
||||||
id: extract_icon_name
|
id: extract_icon_name
|
||||||
run: echo "ICON_NAME=$(python scripts/print_icon_name.py ${{ env.ICON_TYPE }} update)" >> "$GITHUB_OUTPUT"
|
run: echo "ICON_NAME=$(python scripts/print_icon_name.py ${{ env.ICON_TYPE }} update)" >> "$GITHUB_OUTPUT"
|
||||||
env:
|
env:
|
||||||
INPUT_ISSUE_FORM: ${{ steps.parse_issue_form.outputs.ISSUE_FORM }}
|
INPUT_ISSUE_FORM: ${{ steps.parse_issue_form.outputs.ISSUE_FORM }}
|
||||||
|
- name: Compress icons
|
||||||
|
run: |
|
||||||
|
echo "Compressing PNGs..."
|
||||||
|
find png/ -iname "${{ steps.extract_icon_name.outputs.ICON_NAME }}*.png" -print0 | xargs -0 -P 4 -I{} zopflipng -y {} {}
|
||||||
|
echo "Compressing WEBPs..."
|
||||||
|
find webp/ -iname "${{ steps.extract_icon_name.outputs.ICON_NAME }}*.webp" -print0 | xargs -0 -P 4 -I{} bash -c 'cwebp -quiet -lossless "$1" -o "$1"' _ {}
|
||||||
- name: Commit changes
|
- name: Commit changes
|
||||||
run: |
|
run: |
|
||||||
git config --global user.email "193821040+dashboard-icons-manager[bot]@users.noreply.github.com"
|
git config --global user.email "193821040+dashboard-icons-manager[bot]@users.noreply.github.com"
|
||||||
|
10
.github/workflows/update_icons_and_resources.yml
vendored
10
.github/workflows/update_icons_and_resources.yml
vendored
@ -1,13 +1,6 @@
|
|||||||
name: Update Icons and Resources
|
name: Update Icons and Resources
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- dev
|
|
||||||
paths:
|
|
||||||
- "svg/**"
|
|
||||||
- "png/**"
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@ -59,9 +52,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
python-version: "3.9"
|
python-version: "3.9"
|
||||||
|
|
||||||
- name: Generate File Tree
|
|
||||||
run: python scripts/generate_file_tree.py svg png webp
|
|
||||||
|
|
||||||
- name: Commit and Push Changes
|
- name: Commit and Push Changes
|
||||||
run: |
|
run: |
|
||||||
git config --global user.email "homarr-labs@proton.me"
|
git config --global user.email "homarr-labs@proton.me"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user