Update Icons #215
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update Icons | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
check_versions: | |
runs-on: ubuntu-latest | |
outputs: | |
latest: ${{ steps.latest-version.outputs.LATEST_VERSION }} | |
up_to_date: ${{ steps.current-version.outputs.CURRENT_VERSION == steps.latest-version.outputs.LATEST_VERSION }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.PAT }} | |
submodules: recursive | |
- name: Set current version | |
id: current-version | |
run: | | |
echo "CURRENT_VERSION=$(cd lucide && git describe --tags)" >> "$GITHUB_OUTPUT" | |
echo "CURRENT_VERSION=$(cd lucide && git describe --tags)" >> "$GITHUB_STEP_SUMMARY" | |
- name: Set latest version | |
id: latest-version | |
run: | | |
echo "LATEST_VERSION=$(gh api repos/lucide-icons/lucide/releases/latest | jq -r '.tag_name')" >> "$GITHUB_OUTPUT" | |
echo "LATEST_VERSION=$(gh api repos/lucide-icons/lucide/releases/latest | jq -r '.tag_name')" >> "$GITHUB_STEP_SUMMARY" | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT }} | |
update_icons: | |
needs: | |
- check_versions | |
runs-on: ubuntu-latest | |
if: ${{ needs.check_versions.outputs.up_to_date == 'false' }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.PAT }} | |
submodules: recursive | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: dom, curl, libxml, mbstring, zip | |
coverage: none | |
- name: Install dependencies | |
run: | | |
composer update --prefer-dist --no-interaction --no-progress | |
- name: Update Submodule | |
run: | | |
cd lucide | |
git fetch --all --tags | |
git checkout ${{ needs.check_versions.outputs.latest }} | |
- name: Run Generator | |
run: php vendor/bin/blade-icons-generate | |
- name: Commit Changes | |
uses: EndBug/add-and-commit@v9 | |
with: | |
message: "feat(icons): Update Lucide to https://github.com/lucide-icons/lucide/releases/tag/${{ needs.check_versions.outputs.latest }}" |