Skip to content

Commit 2bd6d40

Browse files
committed
update actions
1 parent 01f28d1 commit 2bd6d40

File tree

5 files changed

+170
-86
lines changed

5 files changed

+170
-86
lines changed

.github/workflows/kicad_outputs.yml

+88-85
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Kicad - production files generator
22

3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: true
6+
37
on:
48
push:
59
paths:
@@ -11,13 +15,14 @@ on:
1115
workflow_dispatch:
1216

1317
env:
14-
schema: "hw/sch_pcb/*.kicad_sch"
15-
board: "hw/sch_pcb/*.kicad_pcb"
18+
schema: "hw/sch_pcb/${{ github.head_ref || github.ref_name }}.kicad_sch"
19+
board: "hw/sch_pcb/${{ github.head_ref || github.ref_name }}.kicad_pcb"
20+
project: ${{ github.event.repository.name }}
21+
branch: ${{ github.head_ref || github.ref_name }}
1622
dir: "hw/out"
1723
kibot: "doc/assets/kibot"
1824

1925
jobs:
20-
# checks
2126
ERC:
2227
runs-on: ubuntu-latest
2328
continue-on-error: true
@@ -28,13 +33,14 @@ jobs:
2833
token: ${{ secrets.pat }}
2934
ref: ${{ github.head_ref }}
3035

31-
- uses: MLAB-project/KiBot@master
36+
- uses: INTI-CMNB/KiBot@v2_dk6
3237
with:
3338
config: ${{ env.kibot }}/erc.kibot.yaml
3439
schema: ${{ env.schema }}
3540
board: ${{ env.board }}
3641
dir: ${{ env.dir }}
3742

43+
3844
DRC:
3945
runs-on: ubuntu-latest
4046
continue-on-error: true
@@ -45,37 +51,14 @@ jobs:
4551
token: ${{ secrets.pat }}
4652
ref: ${{ github.head_ref }}
4753

48-
- uses: MLAB-project/KiBot@master
54+
- uses: INTI-CMNB/KiBot@v2_dk6
4955
with:
5056
config: ${{ env.kibot }}/drc.kibot.yaml
5157
schema: ${{ env.schema }}
5258
board: ${{ env.board }}
5359
dir: ${{ env.dir }}
54-
55-
xml:
56-
runs-on: ubuntu-latest
57-
continue-on-error: true
58-
steps:
59-
- uses: actions/checkout@v3
60-
with:
61-
submodules: recursive
62-
token: ${{ secrets.pat }}
63-
ref: ${{ github.head_ref }}
64-
65-
- uses: MLAB-project/KiBot@master
66-
with:
67-
config: ${{ env.kibot }}/xml.kibot.yaml
68-
schema: ${{ env.schema }}
69-
board: ${{ env.board }}
70-
dir: ${{ env.dir }}
71-
- uses: actions/upload-artifact@v3
72-
if: ${{ success() }}
73-
with:
74-
name: doc_xml
75-
path: hw/sch_pcb/*.xml
76-
7760

78-
# documentation
61+
7962
schematics:
8063
runs-on: ubuntu-latest
8164
continue-on-error: true
@@ -86,7 +69,7 @@ jobs:
8669
token: ${{ secrets.pat }}
8770
ref: ${{ github.head_ref }}
8871

89-
- uses: MLAB-project/KiBot@master
72+
- uses: INTI-CMNB/KiBot@v2_dk6
9073
with:
9174
config: ${{ env.kibot }}/schematics.kibot.yaml
9275
schema: ${{ env.schema }}
@@ -99,57 +82,77 @@ jobs:
9982
name: doc_sch
10083
path: ${{ env.dir }}_docs/**
10184

102-
10385
placement:
86+
name: "Placement and XML"
10487
runs-on: ubuntu-latest
105-
continue-on-error: true
88+
#continue-on-error: true
10689
steps:
10790
- uses: actions/checkout@v3
10891
with:
10992
submodules: recursive
11093
token: ${{ secrets.pat }}
11194
ref: ${{ github.head_ref }}
11295

113-
- uses: MLAB-project/KiBot@master
96+
- uses: INTI-CMNB/KiBot@v2_dk6
11497
with:
11598
config: ${{ env.kibot }}/placement.kibot.yaml
11699
schema: ${{ env.schema }}
117100
board: ${{ env.board }}
118101
dir: ${{ env.dir }}_docs
119102

103+
- uses: INTI-CMNB/KiBot@v2_dk6
104+
with:
105+
config: ${{ env.kibot }}/xml.kibot.yaml
106+
schema: ${{ env.schema }}
107+
board: ${{ env.board }}
108+
dir: ${{ env.dir }}_docs
109+
110+
# - name: "Rename output"
111+
# run: |
112+
# for file in $(find ${{env.dir}} -type f); do sudo mv "${file}" "${file//${{env.project}}/${{env.branch}}}" ; done
113+
# for file in $(find ${{env.dir}}_docs -type f); do sudo mv "${file}" "${file//${{env.project}}/${{env.branch}}}" ; done
114+
115+
- uses: actions/upload-artifact@v3
116+
if: ${{ success() }}
117+
with:
118+
name: doc_xml
119+
path: hw/sch_pcb/*.xml
120+
120121
# Zde se zahazuji debugovaci videa
121122
- uses: actions/upload-artifact@v3
122123
if: ${{ success() }}
123124
with:
124125
name: doc_placement
125-
path: ${{ env.dir }}_docs/**/*.pdf
126-
127-
128-
pnp:
126+
path: |
127+
${{ env.dir }}_docs/**/*.pdf
128+
${{ env.dir }}_docs/**/*.svg
129+
${{ env.dir }}_docs/**/*.csv
130+
131+
report:
129132
runs-on: ubuntu-latest
130-
continue-on-error: true
133+
#continue-on-error: true
131134
steps:
132135
- uses: actions/checkout@v3
133136
with:
134137
submodules: recursive
135138
token: ${{ secrets.pat }}
136139
ref: ${{ github.head_ref }}
137140

138-
- uses: MLAB-project/KiBot@master
141+
- uses: INTI-CMNB/KiBot@v2_dk6
139142
with:
140-
config: ${{ env.kibot }}/pnp.kibot.yaml
143+
config: ${{ env.kibot }}/report.kibot.yaml
141144
schema: ${{ env.schema }}
142145
board: ${{ env.board }}
143-
dir: ${{ env.dir }}_docs
146+
dir: ${{ env.dir }}_report
144147

145-
# Zde se zahazuji debugovaci videa
146148
- uses: actions/upload-artifact@v3
147149
if: ${{ success() }}
148150
with:
149-
name: doc_pnp
150-
path: ${{ env.dir }}_docs/
151+
name: doc_report
152+
path: ${{ env.dir }}_report/
151153

152-
report:
154+
155+
ibom:
153156
runs-on: ubuntu-latest
154157
continue-on-error: true
155158
steps:
@@ -159,21 +162,26 @@ jobs:
159162
token: ${{ secrets.pat }}
160163
ref: ${{ github.head_ref }}
161164

162-
- uses: MLAB-project/KiBot@master
165+
- uses: INTI-CMNB/KiBot@v2_dk6
163166
with:
164-
config: ${{ env.kibot }}/report.kibot.yaml
167+
config: ${{ env.kibot }}/ibom.kibot.yaml
165168
schema: ${{ env.schema }}
166169
board: ${{ env.board }}
167-
dir: ${{ env.dir }}_report
170+
dir: ${{ env.dir }}_ibom
171+
172+
- name: "Rename output"
173+
run: for file in $(find ${{env.dir}} -type f); do sudo mv "${file}" "${file//${{env.project}}/${{env.branch}}}" ; done
168174

169175
- uses: actions/upload-artifact@v3
170176
if: ${{ success() }}
171177
with:
172-
name: doc_report
173-
path: ${{ env.dir }}_report/
178+
name: doc_ibom
179+
path: ${{ env.dir }}_ibom/
180+
174181

175182
# fabrications
176183
gerbers:
184+
name: "Fabrication: Gerebrs, Drill and PnP"
177185
runs-on: ubuntu-latest
178186
continue-on-error: true
179187
steps:
@@ -183,13 +191,16 @@ jobs:
183191
token: ${{ secrets.pat }}
184192
ref: ${{ github.head_ref }}
185193

186-
- uses: MLAB-project/KiBot@master
194+
- uses: INTI-CMNB/KiBot@v2_dk6
187195
with:
188196
config: ${{ env.kibot }}/gerbers.kibot.yaml
189197
schema: ${{ env.schema }}
190198
board: ${{ env.board }}
191199
dir: ${{ env.dir }}_gerbers
192200
verbose: 3
201+
202+
- name: "Rename output"
203+
run: for file in $(find ${{env.dir}}_gerbers -type f); do sudo mv "${file}" "${file//${{env.project}}/${{env.branch}}}" ; done
193204

194205
- uses: actions/upload-artifact@v2
195206
if: ${{ success() }}
@@ -198,65 +209,55 @@ jobs:
198209
path: ${{ env.dir }}_gerbers/gerbers/**
199210

200211

201-
cad:
212+
graphics:
213+
name: "CAD and render"
202214
runs-on: ubuntu-latest
203-
continue-on-error: true
215+
#continue-on-error: true
204216
steps:
205217
- uses: actions/checkout@v3
206218
with:
207219
submodules: recursive
208220
token: ${{ secrets.pat }}
209221
ref: ${{ github.head_ref }}
210222

211-
- uses: MLAB-project/KiBot@master
223+
- uses: INTI-CMNB/KiBot@v2_dk6
212224
with:
213225
config: ${{ env.kibot }}/cad.kibot.yaml
214226
schema: ${{ env.schema }}
215227
board: ${{ env.board }}
216228
dir: ${{ env.dir }}_cad
217-
218-
- uses: actions/upload-artifact@v3
219-
if: ${{ success() }}
220-
with:
221-
name: doc_cad
222-
path: ${{ env.dir }}_cad/**
223-
224-
225-
render:
226-
runs-on: ubuntu-latest
227-
continue-on-error: true
228-
steps:
229-
- uses: actions/checkout@v3
230-
with:
231-
submodules: recursive
232-
token: ${{ secrets.pat }}
233-
ref: ${{ github.head_ref }}
234229

235-
- uses: MLAB-project/KiBot@master
230+
- uses: INTI-CMNB/KiBot@v2_dk6
236231
with:
237232
config: ${{ env.kibot }}/render.kibot.yaml
238233
schema: ${{ env.schema }}
239234
board: ${{ env.board }}
240235
dir: ${{ env.dir }}_img
241236
verbose: 3
237+
238+
- uses: actions/upload-artifact@v3
239+
if: ${{ success() }}
240+
with:
241+
name: doc_cad
242+
path: ${{ env.dir }}_cad/**
242243

243244
- uses: actions/upload-artifact@v3
244245
if: ${{ success() }}
245246
with:
246247
name: doc_img
247248
path: ${{ env.dir }}_img/img/**
248249

250+
249251
UPDATE_REPO:
250252
runs-on: ubuntu-latest
251-
name: Update repozitory.
252-
needs: [render, cad, gerbers, schematics, pnp, xml, placement]
253+
name: Update repository
254+
needs: [graphics, gerbers, schematics, placement, report, ibom]
253255
steps:
254256
- uses: actions/checkout@v3
255257
with:
256258
ref: ${{ github.head_ref }}
257259
token: ${{ secrets.pat }}
258260

259-
260261
- run: |
261262
git pull --force --rebase || true
262263
git submodule update --remote || true
@@ -267,44 +268,46 @@ jobs:
267268
- name: Remove old manufarturing data
268269
run: |
269270
rm -r hw/cam_profi || true
270-
rw -r doc/gen || true
271+
rm -r doc/gen || true
271272
272273
- name: Extract to right position
273274
run: |
274275
275276
mkdir doc || true
276277
mkdir doc/gen || true
277278
mkdir doc/gen/img || true
279+
mkdir doc/img || true
278280
mkdir doc/img/render || true
279281
mkdir hw || true
280282
mkdir hw/cam_profi || true
283+
mkdir hw/cam_profi/ibom || true
281284

282285
cp doc/assets/kibot/autogenerated.md hw/cam_profi.readme.md || true
283286

284287
cp -r doc_img/* doc/gen/img || true
285288
cp -r doc_cad/cad/* doc/gen || true
286289
cp -r hw_cam_profi/* hw/cam_profi || true
287290
cp -r doc_sch/docs/* doc/gen || true
288-
cp -r doc_xml/* doc/gen || true
291+
cp -r doc_xml/* hw/cam_profi || true
289292
cp -r doc_sch/img/pcb/* doc/gen/img || true
290293
cp -r doc_placement/doc* hw/cam_profi || true
291-
cp -r doc_pnp/* hw/cam_profi || true
292294
cp -r doc_report/* doc/gen || true
295+
cp -r doc_ibom/docs/* hw/cam_profi/ibom || true
293296

294-
295297
rm -r doc_img || true
296298
rm -r doc_cad || true
297299
rm -r hw_cam_profi || true
298300
rm -r doc_sch || true
299301
rm -r doc_placement || true
300-
rm -r doc_pnp || true
301302
rm -r doc_xml || true
302303
rm -r doc_report || true
303-
304+
rm -r doc_ibom || true
305+
306+
tree
304307

305-
- uses: stefanzweifel/git-auto-commit-action@v4
308+
git add . -f
309+
310+
- uses: stefanzweifel/[email protected]
306311
with:
307312
commit_message: Update actions products
308-
add_options: '-A'
309-
commit_options: '-a'
310-
313+
add_options: '-A -f'

0 commit comments

Comments
 (0)