-
Notifications
You must be signed in to change notification settings - Fork 323
162 lines (132 loc) · 6.19 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
name: Export ECAD
on:
workflow_dispatch:
release:
types: [ published ]
jobs:
export-ecad:
name: Export ECAD
runs-on: ubuntu-latest
container: ghcr.io/inti-cmnb/kicad8_auto
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
sed -i "s!<<hash>>!${COMMIT}!" pnp/pcb/x-cable-chain-support/x-cable-chain-support.kicad_pcb
sed -i "s!<<hash>>!${COMMIT}!" pnp/pcb/xy-limit/xy-limit.kicad_pcb
sed -i "s!<<hash>>!${COMMIT}!" pnp/pcb/z-limit/z-limit.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
sed -i "s!<<hash>>!BETA-${COMMIT}!" pnp/pcb/x-cable-chain-support/x-cable-chain-support.kicad_pcb
sed -i "s!<<hash>>!BETA-${COMMIT}!" pnp/pcb/xy-limit/xy-limit.kicad_pcb
sed -i "s!<<hash>>!BETA-${COMMIT}!" pnp/pcb/z-limit/z-limit.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-nobom.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/
# x cable chain support
- name: Generate X cable chain support Export Files
run: |
cd pnp/pcb/x-cable-chain-support
rm -rf x-cable-chain-support/
kibot -c ../../../.github/workflows/scripts/kibot/config-2layer.kibot.yaml -e x-cable-chain-support.kicad_sch -b x-cable-chain-support.kicad_pcb -d x-cable-chain-support
zip -r -j x-cable-chain-support.zip x-cable-chain-support/
# xy limit
- name: Generate XY Limit Export Files
run: |
cd pnp/pcb/xy-limit
rm -rf xy-limit/
kibot -c ../../../.github/workflows/scripts/kibot/config-2layer.kibot.yaml -e xy-limit.kicad_sch -b xy-limit.kicad_pcb -d xy-limit
zip -r -j xy-limit.zip xy-limit/
# z limit
- name: Generate X cable chain support Export Files
run: |
cd pnp/pcb/z-limit
rm -rf z-limit/
kibot -c ../../../.github/workflows/scripts/kibot/config-2layer.kibot.yaml -e z-limit.kicad_sch -b z-limit.kicad_pcb -d z-limit
zip -r -j z-limit.zip z-limit/
# 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 x-cable-chain-support/x-cable-chain-support.zip xy-limit/xy-limit.zip z-limit/z-limit.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 x-cable-chain-support/x-cable-chain-support.zip xy-limit/xy-limit.zip z-limit/z-limit.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