mirror of
https://github.com/walkxcode/dashboard-icons.git
synced 2025-11-01 01:07:57 +01:00
🚀 Much needed maintenance
This commit is contained in:
33
.github/workflows/compress_pngs.yml
vendored
Normal file
33
.github/workflows/compress_pngs.yml
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
name: Compress PNGs 🗜️
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 0 * * 0"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
compress_pngs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y zopfli
|
||||
|
||||
- name: Compress PNG Files
|
||||
run: |
|
||||
echo "Compressing PNGs..."
|
||||
find png/ -iname "*.png" -print0 | xargs -0 -P 4 -I{} zopflipng -y {} {}
|
||||
|
||||
- name: Commit and Push Changes
|
||||
run: |
|
||||
git config --global user.email "noreply@lammers.media"
|
||||
git config --global user.name "Dashboard Icons Bot"
|
||||
git add png/
|
||||
git commit -m ":compression: Compressed PNGs" || exit 0
|
||||
git pull --rebase
|
||||
git push
|
||||
31
.github/workflows/generate_file_tree.yml
vendored
Normal file
31
.github/workflows/generate_file_tree.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
name: Generate File Tree 🌳
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
generate_file_tree:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set Up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: "3.9"
|
||||
|
||||
- name: Generate File Tree
|
||||
run: python scripts/generate_file_tree.py svg png webp
|
||||
|
||||
- name: Commit and Push Changes
|
||||
run: |
|
||||
git config --global user.email "noreply@lammers.media"
|
||||
git config --global user.name "Dashboard Icons Bot"
|
||||
git add tree.json
|
||||
git commit -m ":construction_worker: Generate file tree" || exit 0
|
||||
git push
|
||||
31
.github/workflows/generate_icons_page.yml
vendored
Normal file
31
.github/workflows/generate_icons_page.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
name: Generate Icons Page 🚀
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build_icons_page:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set Up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: "3.9"
|
||||
|
||||
- name: Generate ICONS.md
|
||||
run: python scripts/generate_icons_page.py
|
||||
|
||||
- name: Commit and Push Changes
|
||||
run: |
|
||||
git config --global user.email "noreply@lammers.media"
|
||||
git config --global user.name "Dashboard Icons Bot"
|
||||
git add ICONS.md
|
||||
git commit -m ":construction_worker: Generate ICONS.md" || exit 0
|
||||
git push
|
||||
32
.github/workflows/icons-page-generation.yml
vendored
32
.github/workflows/icons-page-generation.yml
vendored
@@ -1,32 +0,0 @@
|
||||
name: 🚀 Generates ICONS
|
||||
|
||||
on:
|
||||
push:
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: "3.9"
|
||||
architecture: "x64"
|
||||
|
||||
- name: ICONS Generator
|
||||
run: |-
|
||||
python config/ci.py
|
||||
cat ICONS.md
|
||||
|
||||
- name: Load to GitHub
|
||||
run: |-
|
||||
git diff
|
||||
git config --global user.email "noreply@lammers.media"
|
||||
git config --global user.name "Dashboard Icons Bot"
|
||||
git add -A
|
||||
git commit -m ":construction_worker: Generates ICONS.md" || exit 0
|
||||
git push
|
||||
32
.github/workflows/png-compression.yml
vendored
32
.github/workflows/png-compression.yml
vendored
@@ -1,32 +0,0 @@
|
||||
name: 🗜️ PNG Compression
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 0 * * 0"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
compress-images:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y zopfli
|
||||
|
||||
- name: Compress PNGs
|
||||
run: |
|
||||
echo "Compressing PNGs..."
|
||||
find png/ -iname "*.png" -print0 | xargs -0 -P 4 -I{} sh -c 'echo "Compressing {}"; zopflipng -y {} {}' || true
|
||||
|
||||
- name: Load to GitHub
|
||||
run: |-
|
||||
git diff
|
||||
git config --global user.email "noreply@walkx.fyi"
|
||||
git config --global user.name "Dashboard Icons Bot"
|
||||
git add -A
|
||||
git commit -m ":children_crossing: Compresses PNGs" || exit 0
|
||||
git pull --ff-only
|
||||
git push
|
||||
72
.github/workflows/validate_and_preview_icons.yml
vendored
Normal file
72
.github/workflows/validate_and_preview_icons.yml
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
name: Validate and Preview Icons 🛠️
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize]
|
||||
|
||||
jobs:
|
||||
validate_icons:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set Up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: "3.9"
|
||||
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
pip install cairosvg pillow
|
||||
|
||||
- name: Run SVG to PNG and WEBP Conversion
|
||||
run: python scripts/convert_svg_assets.py
|
||||
|
||||
- name: Upload Converted Icons
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: converted-icons
|
||||
path: |
|
||||
png/*.png
|
||||
webp/*.webp
|
||||
|
||||
- name: Post Comment with Preview
|
||||
uses: marocchino/sticky-pull-request-comment@v2
|
||||
with:
|
||||
message: |
|
||||
## Icon Conversion Results
|
||||
|
||||
**Total Icons Processed:** ${{ steps.process.outputs.total_icons }}
|
||||
**Converted PNGs:** ${{ steps.process.outputs.converted_pngs }}
|
||||
**Converted WEBPs:** ${{ steps.process.outputs.converted_webps }}
|
||||
**Removed PNGs:** ${{ steps.process.outputs.removed_pngs }}
|
||||
**Removed WEBPs:** ${{ steps.process.outputs.removed_webps }}
|
||||
|
||||
${{ steps.process.outputs.failed_files }}
|
||||
|
||||
### Preview of Converted Icons:
|
||||
|
||||
${{ steps.preview.outputs.icon_previews }}
|
||||
- name: Set Output Variables
|
||||
id: process
|
||||
run: |
|
||||
echo "::set-output name=total_icons::$(grep 'Total icons:' output.log | awk '{print $3}')"
|
||||
echo "::set-output name=converted_pngs::$(grep 'Converted' output.log | awk '{print $2}')"
|
||||
echo "::set-output name=converted_webps::$(grep 'Converted' output.log | awk '{print $5}')"
|
||||
echo "::set-output name=removed_pngs::$(grep 'Removed' output.log | awk '{print $2}')"
|
||||
echo "::set-output name=removed_webps::$(grep 'Removed' output.log | awk '{print $5}')"
|
||||
echo "::set-output name=failed_files::$(grep 'The following files failed' -A 10 output.log)"
|
||||
|
||||
- name: Generate Icon Previews
|
||||
id: preview
|
||||
run: |
|
||||
ICONS=$(find png/ -type f -name "*.png")
|
||||
PREVIEWS=""
|
||||
for ICON in $ICONS; do
|
||||
ICON_NAME=$(basename $ICON)
|
||||
PREVIEW=""
|
||||
PREVIEWS="$PREVIEWS $PREVIEW"
|
||||
done
|
||||
echo "::set-output name=icon_previews::$PREVIEWS"
|
||||
Reference in New Issue
Block a user