-
-
Notifications
You must be signed in to change notification settings - Fork 26
144 lines (132 loc) · 5.46 KB
/
Copy pathatopile.yml
File metadata and controls
144 lines (132 loc) · 5.46 KB
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
name: Electronics Build (Atopile)
on:
pull_request:
branches: [main]
paths:
- 'ecad/**'
- '.github/workflows/atopile.yml'
push:
branches: [main]
paths:
- 'ecad/**'
- '.github/workflows/atopile.yml'
release:
types: [published]
workflow_dispatch:
jobs:
atopile:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
# Official atopile action: resolves the version from requires-atopile
# in ato.yaml and provides `ato` via the atopile-kicad container
# (which bundles kicad-cli), tagged locally as `atopile-local`.
- name: Setup atopile
uses: atopile/setup-atopile@v2
with:
ato-config: ecad/ato.yaml
# Verify every target builds from the checked-in sources WITHOUT
# modifying the checked-in layouts. We don't use `ato build --frozen`
# because atopile 0.15.x writes group member lists in nondeterministic
# order, making frozen flaky; instead we build, canonicalize that
# ordering, and require the working tree to be unchanged.
# The LCSC/EasyEDA API is intermittently flaky, hence the retries.
- name: Build all targets
working-directory: ecad
run: |
ok=0
for i in 1 2 3; do
if ato build --keep-picked-parts --keep-net-names --keep-designators; then
ok=1; break
fi
echo "build failed (attempt $i), retrying in 60s..."; sleep 60
done
[ "$ok" = "1" ]
- name: Verify checked-in layouts are unchanged
working-directory: ecad
run: |
python3 scripts/canonicalize-boards.py --all
if ! git diff --exit-code --stat -- elec/layout elec/src; then
echo "::error::Building modified the checked-in design files."
echo "::error::Run 'ato build' + 'scripts/canonicalize-boards.py --all' locally and commit the result."
exit 1
fi
# Manufacturing artifacts for the two real boards:
# -t all -> gerber zip, pick & place, BOM, STEP, GLB
# -t 3d-image -> rendered PNG
- name: Export gerbers / STEP / PNG
working-directory: ecad
run: |
ok=0
for i in 1 2 3; do
if ato build -b box-emu -b box-3-emu -t all -t 3d-image \
--keep-picked-parts --keep-net-names --keep-designators; then
ok=1; break
fi
echo "build failed (attempt $i), retrying in 60s..."; sleep 60
done
[ "$ok" = "1" ]
# PDFs are not an atopile target; render them with the kicad-cli
# bundled in the same atopile-kicad container the action pulled.
- name: Export PDFs
working-directory: ecad
run: |
for b in box-emu box-3-emu; do
docker run --rm -v "$PWD:/work" -w /work --entrypoint kicad-cli atopile-local \
pcb export pdf --layers "F.Cu,F.Mask,F.SilkS,Edge.Cuts" \
--output "build/builds/$b/$b.top.pdf" "elec/layout/$b/$b.kicad_pcb"
docker run --rm -v "$PWD:/work" -w /work --entrypoint kicad-cli atopile-local \
pcb export pdf --mirror --layers "B.Cu,B.Mask,B.SilkS,Edge.Cuts" \
--output "build/builds/$b/$b.bottom.pdf" "elec/layout/$b/$b.kicad_pcb"
done
- name: Collect release bundles
working-directory: ecad
run: |
for b in box-emu box-3-emu; do
zip -j "$b.zip" \
"build/builds/$b/$b.gerber.zip" \
"build/builds/$b/$b.pcba.step" \
"build/builds/$b/$b.pcba.png" \
"build/builds/$b/$b.pcba.glb" \
"build/builds/$b/$b.top.pdf" \
"build/builds/$b/$b.bottom.pdf" \
"build/builds/$b/$b.bom.csv" \
"build/builds/$b/$b.pick_and_place.csv" \
"build/builds/$b/$b.jlcpcb_pick_and_place.csv"
done
- name: Upload Box-Emu
uses: actions/upload-artifact@v7
with:
name: box-emu
path: |
ecad/build/builds/box-emu/box-emu.gerber.zip
ecad/build/builds/box-emu/box-emu.pcba.step
ecad/build/builds/box-emu/box-emu.pcba.png
ecad/build/builds/box-emu/box-emu.pcba.glb
ecad/build/builds/box-emu/box-emu.top.pdf
ecad/build/builds/box-emu/box-emu.bottom.pdf
ecad/build/builds/box-emu/box-emu.bom.csv
ecad/build/builds/box-emu/box-emu.pick_and_place.csv
ecad/build/builds/box-emu/box-emu.jlcpcb_pick_and_place.csv
- name: Upload Box-3-Emu
uses: actions/upload-artifact@v7
with:
name: box-3-emu
path: |
ecad/build/builds/box-3-emu/box-3-emu.gerber.zip
ecad/build/builds/box-3-emu/box-3-emu.pcba.step
ecad/build/builds/box-3-emu/box-3-emu.pcba.png
ecad/build/builds/box-3-emu/box-3-emu.pcba.glb
ecad/build/builds/box-3-emu/box-3-emu.top.pdf
ecad/build/builds/box-3-emu/box-3-emu.bottom.pdf
ecad/build/builds/box-3-emu/box-3-emu.bom.csv
ecad/build/builds/box-3-emu/box-3-emu.pick_and_place.csv
ecad/build/builds/box-3-emu/box-3-emu.jlcpcb_pick_and_place.csv
- name: Attach files to release
uses: softprops/action-gh-release@v2
if: ${{ github.event.release && github.event.action == 'published' }}
with:
files: |
ecad/box-3-emu.zip
ecad/box-emu.zip