-
Notifications
You must be signed in to change notification settings - Fork 3
226 lines (182 loc) · 7.87 KB
/
export-ecad.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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
name: Export ECAD
on:
workflow_dispatch:
release:
types: [ published ]
jobs:
export-ecad:
name: Export ECAD
runs-on: ubuntu-latest
container: setsoft/kicad_auto:dev_k6
steps:
- name: Generate Short SHA Environment Variable
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
- name: Update system repositories, Install Required Libraries and Initialize git-lfs
run: |
apt update
apt -y install git git-lfs zip librsvg2-bin imagemagick
git lfs install
- name: Checkout Repository
uses: actions/checkout@v2
with:
lfs: true
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Update the PCBs with on default branch with git hash
if: github.event_name == 'release' || steps.extract_branch.outputs.branch == env.main_branch
run: |
export COMMIT=$(git rev-parse --short HEAD)
echo "COMMIT = ${COMMIT}"
echo "ref: ${{ github.ref }}"
echo "default: ${{ env.default }}"
sed -i "s!<<hash>>!${COMMIT}!" pnp/pcb/mobo/mobo.kicad_pcb
sed -i "s!<<hash>>!${COMMIT}!" pnp/pcb/ring-light/ringLight.kicad_pcb
sed -i "s!<<hash>>!${COMMIT}!" pnp/pcb/staging-plate/staging-plate.kicad_pcb
sed -i "s!<<hash>>!${COMMIT}!" pnp/pcb/datum/datum.kicad_pcb
sed -i "s!<<hash>>!${COMMIT}!" pnp/pcb/ftp/ftp.kicad_pcb
- name: Update the PCBs with the git hash and BETA.
if: steps.extract_branch.outputs.branch != env.main_branch
run: |
export COMMIT=$(git rev-parse --short HEAD)
echo "COMMIT = ${COMMIT}"
sed -i "s!<<hash>>!BETA-${COMMIT}!" pnp/pcb/mobo/mobo.kicad_pcb
sed -i "s!<<hash>>!BETA-${COMMIT}!" pnp/pcb/ring-light/ringLight.kicad_pcb
sed -i "s!<<hash>>!BETA-${COMMIT}!" pnp/pcb/staging-plate/staging-plate.kicad_pcb
sed -i "s!<<hash>>!BETA-${COMMIT}!" pnp/pcb/datum/datum.kicad_pcb
sed -i "s!<<hash>>!BETA-${COMMIT}!" pnp/pcb/ftp/ftp.kicad_pcb
#mobo
- name: Generate Mobo Export Files
run: |
cd pnp/pcb/mobo
rm -rf mobo/
kibot -c ../../../.github/workflows/scripts/kibot/config-4layer.kibot.yaml -e mobo.kicad_sch -b mobo.kicad_pcb -d mobo
zip -r -j mobo.zip mobo/
#ringlight
- name: Generate Ring Light Export Files
run: |
cd pnp/pcb/ring-light
rm -rf ringLight/
kibot -c ../../../.github/workflows/scripts/kibot/config-2layer.kibot.yaml -e ringLight.kicad_sch -b ringLight.kicad_pcb -d ringLight
zip -r -j ringLight.zip ringLight/
#datum
- name: Generate Datum Board Export Files
run: |
cd pnp/pcb/datum
rm -rf datum/
kibot -c ../../../.github/workflows/scripts/kibot/config-2layer.kibot.yaml -e datum.kicad_sch -b datum.kicad_pcb -d datum
zip -r -j datum.zip datum/
#staging-plate
- name: Generate Staging Plate Export Files
run: |
cd pnp/pcb/staging-plate
rm -rf staging-plate/
kibot -c ../../../.github/workflows/scripts/kibot/config-2layer.kibot.yaml -e staging-plate.kicad_sch -b staging-plate.kicad_pcb -d staging-plate
zip -r -j staging-plate.zip staging-plate/
#ftp
- name: Generate FTP Export Files
run: |
cd pnp/pcb/ftp
rm -rf ftp/
kibot -c ../../../.github/workflows/scripts/kibot/config-2layer.kibot.yaml -e ftp.kicad_sch -b ftp.kicad_pcb -d ftp
zip -r -j ftp.zip ftp/
# Zip and Upload
- name: Zip Mobo Export Files for Artifacts
run: |
cd pnp/pcb/
zip -r -j LumenPnP-PCBs.zip mobo/mobo.zip ring-light/ringLight.zip datum/datum.zip staging-plate/staging-plate.zip ftp/ftp.zip
- name: Zip Mobo Export Files for Release
run: |
cd pnp/pcb/
zip -r -j LumenPnP-PCBs-${{ github.event.release.tag_name }}.zip mobo/mobo.zip ring-light/ringLight.zip datum/datum.zip staging-plate/staging-plate.zip ftp/ftp.zip
- name: Upload Mobo Export Files as Artifacts
uses: actions/upload-artifact@v2
with:
name: LumenPnP-PCBs.zip
path: pnp/pcb/LumenPnP-PCBs.zip
if-no-files-found: error
retention-days: 60
- name: Upload Artifacts to Release
uses: softprops/action-gh-release@v1
if: github.event_name == 'release'
with:
files: |
pnp/pcb/LumenPnP-PCBs-${{ github.event.release.tag_name }}.zip
#feeder
export-feeder-ecad:
name: Export Feeder ECAD
runs-on: ubuntu-latest
container: setsoft/kicad_auto:dev_k6
steps:
- name: Update system repositories
run: |
apt update
apt -y install git git-lfs zip librsvg2-bin imagemagick
- name: Checkout Repository
uses: actions/checkout@v2
with:
lfs: true
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Update the PCBs with the git hash
if: github.event_name == 'release' || steps.extract_branch.outputs.branch == env.main_branch
run: |
export COMMIT=$(git rev-parse --short HEAD)
echo "COMMIT = ${COMMIT}"
sed -i "s!<<hash>>!${COMMIT}!" feeder/pcb/mobo/mobo.kicad_pcb
sed -i "s!<<hash>>!${COMMIT}!" feeder/pcb/feederFloor/feederFloor.kicad_pcb
sed -i "s!<<hash>>!${COMMIT}!" feeder/pcb/indexingWheel/indexingWheel.kicad_pcb
- name: Update the PCBs with the git hash and Beta
if: steps.extract_branch.outputs.branch != env.main_branch
run: |
export COMMIT=$(git rev-parse --short HEAD)
echo "COMMIT = ${COMMIT}"
sed -i "s!<<hash>>!BETA-${COMMIT}!" feeder/pcb/mobo/mobo.kicad_pcb
sed -i "s!<<hash>>!BETA-${COMMIT}!" feeder/pcb/feederFloor/feederFloor.kicad_pcb
sed -i "s!<<hash>>!BETA-${COMMIT}!" feeder/pcb/indexingWheel/indexingWheel.kicad_pcb
# feeder main board
- name: Generate Feeder Motherboard Export Files
run: |
cd feeder/pcb/mobo
rm -rf feederMobo/
kibot -c ../../../.github/workflows/scripts/kibot/config-2layer.kibot.yaml -e mobo.kicad_sch -b mobo.kicad_pcb -d feederMobo
zip -r -j feederMobo.zip feederMobo/
# indexing wheel
- name: Generate Indexing Wheel Export Files
run: |
cd feeder/pcb/indexingWheel
rm -rf indexingWheel
kibot -c ../../../.github/workflows/scripts/kibot/config-2layer.kibot.yaml -e indexingWheel.kicad_sch -b indexingWheel.kicad_pcb -d indexingWheel
zip -r -j indexingWheel.zip indexingWheel/
# feeder floor
- name: Generate Feeder Floor Export Files
run: |
cd feeder/pcb/feederFloor
rm -rf feederFloor
kibot -c ../../../.github/workflows/scripts/kibot/config-2layer.kibot.yaml -e feederFloor.kicad_sch -b feederFloor.kicad_pcb -d feederFloor
zip -r -j feederFloor.zip feederFloor/
# Zip and Upload
- name: Zip Feeder Export Files for Artifacts
run: |
cd feeder/pcb/
zip -r -j Feeder-PCBs.zip mobo/feederMobo.zip indexingWheel/indexingWheel.zip feederFloor/feederFloor.zip
- name: Zip Feeder Export Files for Release
run: |
cd feeder/pcb/
zip -r -j Feeder-PCBs-${{ github.event.release.tag_name }}.zip feederMobo/feederMobo.zip indexingWheel/indexingWheel.zip feederFloor/feederFloor.zip
- name: Upload Feeder Export Files as Artifacts
uses: actions/upload-artifact@v2
with:
name: Feeder-PCBs.zip
path: feeder/pcb/Feeder-PCBs.zip
if-no-files-found: error
retention-days: 60
- name: Upload Artifacts to Release
uses: softprops/action-gh-release@v1
if: github.event_name == 'release'
with:
files: |
feeder/pcb/Feeder-PCBs-${{ github.event.release.tag_name }}.zip