-
Notifications
You must be signed in to change notification settings - Fork 1
92 lines (79 loc) · 3.46 KB
/
update-packs.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
84
85
86
87
88
89
90
91
92
name: Update icons packs by re-generating them
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 5'
jobs:
re-generate-icon-packs:
name: Re-generate icon packs
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Ruby 3.3.4
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3.4
bundler-cache: true
- name: Configure git
run: |
git config --global user.email "[email protected]"
git config --global user.name "Ali Hamdi Ali Fadel"
- name: Re-generate Bootstrap icon pack
run: |
bundle exec ruby generators/bootstrap.rb
if [ -n "$(git status --porcelain lib/phlex/icons/bootstrap lib/phlex/icons/bootstrap.rb)" ]; then
git add lib/phlex/icons/bootstrap lib/phlex/icons/bootstrap.rb
git commit -m "Re-generate Bootstrap icon pack"
fi
- name: Re-generate Flag icon pack
run: |
bundle exec ruby generators/flag.rb
if [ -n "$(git status --porcelain lib/phlex/icons/flag lib/phlex/icons/flag.rb)" ]; then
git add lib/phlex/icons/flag lib/phlex/icons/flag.rb
git commit -m "Re-generate Flag icon pack"
fi
- name: Re-generate Hero icon pack
run: |
bundle exec ruby generators/hero.rb
if [ -n "$(git status --porcelain lib/phlex/icons/hero lib/phlex/icons/hero.rb)" ]; then
git add lib/phlex/icons/hero lib/phlex/icons/hero.rb
git commit -m "Re-generate Hero icon pack"
fi
- name: Re-generate Lucide icon pack
run: |
bundle exec ruby generators/lucide.rb
if [ -n "$(git status --porcelain lib/phlex/icons/lucide lib/phlex/icons/lucide.rb)" ]; then
git add lib/phlex/icons/lucide lib/phlex/icons/lucide.rb
git commit -m "Re-generate Lucide icon pack"
fi
- name: Re-generate Remix icon pack
run: |
bundle exec ruby generators/remix.rb
if [ -n "$(git status --porcelain lib/phlex/icons/remix lib/phlex/icons/remix.rb)" ]; then
git add lib/phlex/icons/remix lib/phlex/icons/remix.rb
git commit -m "Re-generate Remix icon pack"
fi
- name: Re-generate Radix icon pack
run: |
bundle exec ruby generators/radix.rb
if [ -n "$(git status --porcelain lib/phlex/icons/radix lib/phlex/icons/radix.rb)" ]; then
git add lib/phlex/icons/radix lib/phlex/icons/radix.rb
git commit -m "Re-generate Radix icon pack"
fi
- name: Re-generate Tabler icon pack
run: |
bundle exec ruby generators/tabler.rb
if [ -n "$(git status --porcelain lib/phlex/icons/tabler lib/phlex/icons/tabler.rb)" ]; then
git add lib/phlex/icons/tabler lib/phlex/icons/tabler.rb
git commit -m "Re-generate Tabler icon pack"
fi
- name: Update version file
run: |
if [ -n "$(git status --porcelain)" ]; then
current_version=$(grep 'VERSION = ' lib/phlex/icons/version.rb | cut -d '=' -f 2- | tr -d ' ' | tr -d \')
new_version=$(echo $current_version | awk -F. -v OFS=. '{$2++; $3=0; print}')
sed -i "s/VERSION = '$current_version'/VERSION = '$new_version'/" lib/phlex/icons/version.rb
git add lib/phlex/icons/version.rb
git commit -m "Update version to $new_version"
fi