forked from mallardduck/blade-lucide-icons
-
Notifications
You must be signed in to change notification settings - Fork 1
83 lines (69 loc) · 2.57 KB
/
update-lucide.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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 require illuminate/contracts "^10.0" --prefer-dist --no-interaction --no-update
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: Update Snapshots
run: vendor/bin/phpunit -d --update-snapshots
- name: Run Tests
run: vendor/bin/phpunit
- name: Restore original composer.json
run: |
composer remove illuminate/contracts --no-interaction
- 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 }}"