Skip to content

Modify Icons

Modify Icons #19

Workflow file for this run

name: Modify Icons
on:
workflow_dispatch:
jobs:
process:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.fetch_tag.outputs.latest_tag }}
steps:
# Step 1: Checkout Fork Repo
- name: Checkout Fork Repo
uses: actions/checkout@v4
with:
fetch-depth: 0
# Step 2: Set up Node.js environment
- name: Set up Node.js
uses: actions/setup-node@v4
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 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
- name: Zip Icons
run: |
ZIP_FILE="$HOME/kustom-tabler-icons.zip"
zip -r $ZIP_FILE icons/combined
echo "ZIP_FILE=$ZIP_FILE" >> $GITHUB_ENV
# Step 9: Fetch Latest Tag from Upstream
- name: Fetch Latest Tag from Upstream
id: fetch_tag
run: |
LATEST_TAG=$(curl -s https://api.github.com/repos/tabler/tabler-icons/releases/latest | jq -r .tag_name)
echo "LATEST_TAG=${LATEST_TAG}" >> $GITHUB_ENV
# Step 10: Create or Update GitHub Release and Upload Asset
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: ${{ env.ZIP_FILE }}
name: "Kustom Tabler Icons ${{ steps.fetch_tag.outputs.latest_tag }}"
tag_name: ${{ steps.fetch_tag.outputs.latest_tag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}