-
Notifications
You must be signed in to change notification settings - Fork 7
205 lines (177 loc) · 5.54 KB
/
auto_build_unicons.yaml
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
name: Auto build Unicons
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: "16.14.0"
- name: Configure SSH key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Configure Git
run: |
git config --global user.name "Pedro Lemos"
git config --global user.email "[email protected]"
- name: Configure auto_build
run: |
cd auto_build
npm install
npm install -g fontello-cli
- name: Obtain all SVG files from Unicons
run: |
cd auto_build
cd scripts
sh get_line_icons_in_svg.sh
cd ..
cd scripts
sh rename_line_icons.sh
- name: Generate config files for each style
run: |
cd auto_build
npm run generate_configs
- name: Workaround to make fontello-cli work properly
if: always()
run: |
cd auto_build
cd output
set +e
npx fontello-cli --config unicons_line_config.json --host https://www.fluttericon.com/ install
rm .fontello-session
set -e
- name: Generate ttf font and Dart class for UniconsLine
if: always()
run: |
cd auto_build
cd output
set +e
npx fontello-cli --config unicons_line_config.json --host https://www.fluttericon.com/ install
rm .fontello-session
set -e
- name: Generate ttf font and Dart class for UniconsSolid
if: always()
run: |
cd auto_build
cd output
set +e
npx fontello-cli --config unicons_solid_config.json --host https://www.fluttericon.com/ install
rm .fontello-session
set -e
- name: Generate ttf font and Dart class for UniconsThinline
if: always()
run: |
cd auto_build
cd output
set +e
npx fontello-cli --config unicons_thinline_config.json --host https://www.fluttericon.com/ install
rm .fontello-session
set -e
- name: Rename all folders to the respective style
run: |
cd auto_build
npm run rename_outputs
- name: Move line icons ttf file
run: |
pwd
ls
cd auto_build
cd output
cd unicons_line_icons
cd fonts
mv *.ttf /home/runner/work/unicons-flutter/unicons-flutter/icons/
- name: Move line icons Dart file
run: |
cd auto_build
cd output
cd unicons_line_icons
mv *.dart unicons_line.dart
mv *.dart /home/runner/work/unicons-flutter/unicons-flutter/lib/src/
- name: Move line icons config file
run: |
cd auto_build
cd output
cd unicons_line_icons
mv *.json unicons_line_config.json
mv *.json /home/runner/work/unicons-flutter/unicons-flutter/config/
- name: Move solid icons ttf file
run: |
cd auto_build
cd output
cd unicons_solid_icons
cd fonts
mv *.ttf /home/runner/work/unicons-flutter/unicons-flutter/icons/
- name: Move solid icons Dart file
run: |
cd auto_build
cd output
cd unicons_solid_icons
mv *.dart unicons_solid.dart
mv *.dart /home/runner/work/unicons-flutter/unicons-flutter/lib/src/
- name: Move solid icons config file
run: |
cd auto_build
cd output
cd unicons_solid_icons
mv *.json unicons_solid_config.json
mv *.json /home/runner/work/unicons-flutter/unicons-flutter/config/
- name: Move thinline icons ttf file
run: |
cd auto_build
cd output
cd unicons_thinline_icons
cd fonts
mv *.ttf /home/runner/work/unicons-flutter/unicons-flutter/icons/
- name: Move thinline icons Dart file
run: |
cd auto_build
cd output
cd unicons_thinline_icons
mv *.dart unicons_thinline.dart
mv *.dart /home/runner/work/unicons-flutter/unicons-flutter/lib/src/
- name: Move thinline icons config file
run: |
cd auto_build
cd output
cd unicons_thinline_icons
mv *.json unicons_thinline_config.json
mv *.json /home/runner/work/unicons-flutter/unicons-flutter/config/
- name: Adjusted generated Dart files
run: |
cd auto_build
npm run adjust_generated_dart_files
- name: Update pubspec.yaml
run: |
cd auto_build
npm run update_pubspec
- name: Update CHANGELOG.md
run: |
cd auto_build
npm run update_changelog
- name: Remove temporary files
run: |
cd auto_build
rm -rf unicons
- name: Create branch with updated icons
run: |
git checkout -b build_${{ github.run_id }}
cd lib
git add .
cd ..
cd icons
git add .
cd ..
cd config
git add .
cd ..
git add pubspec.yaml
git add CHANGELOG.md
git commit -m "ci/cd: generated icons [${{ github.run_id }}]"
git push origin build_${{ github.run_id }}