Skip to content

Modify Icons

Modify Icons #6

Workflow file for this run

name: Modify Icons
on:
workflow_run:
workflows: ["Sync Upstream Icons"]
types:
- completed
workflow_dispatch:
jobs:
process:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout Fork Repo
- name: Checkout Fork Repo
uses: actions/checkout@v3
with:
fetch-depth: 0
# Step 2: Set up Node.js environment
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
# Step 3: Install oslllo-svg-fixer
- name: Install oslllo-svg-fixer
run: npm install -g oslllo-svg-fixer
# Step 4: Create necessary folders
- name: Create necessary folders
run: |
mkdir -p icons/combined
mkdir -p temp-icons
# Step 5: Move and Rename Icons
- name: Move and Rename Filled Icons
run: |
for file in icons/filled/*.svg; do
mv "$file" "icons/combined/$(basename "${file%.svg}")-filled.svg";
done
- name: Move and Rename Outline Icons
run: |
for file in icons/outline/*.svg; do
mv "$file" "temp-icons/$(basename "${file%.svg}")-outline.svg";
done
# Step 6: Run oslllo-svg-fixer
- name: Run oslllo-svg-fixer
run: oslllo-svg-fixer --source temp-icons --destination icons/combined
# Step 7: Commit and Push Changes
- name: Commit and Push Changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
git add icons/combined/
git status
if git commit -m "Processed and updated SVG icons in combined folder"; then
echo "Committed changes."
git push
else
echo "No changes to commit or commit failed."
exit 1
fi
# Step 8: Zip the icons/combined folder
- name: Zip Icons
run: zip -r kustom-tabler-icons.zip icons/combined
# Step 9: Create a GitHub Release
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "latest"
release_name: "Kustom Tabler Icons"
draft: false
prerelease: false
# Step 10: Upload zip file to the release
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./kustom-tabler-icons.zip
asset_name: kustom-tabler-icons.zip
asset_content_type: application/zip