-
Notifications
You must be signed in to change notification settings - Fork 8
78 lines (66 loc) · 3.22 KB
/
Copy path_electrical_build.yml
File metadata and controls
78 lines (66 loc) · 3.22 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
on:
workflow_call:
jobs:
build:
name: kicad export
runs-on: ubuntu-latest
permissions:
packages: write
strategy:
fail-fast: false
matrix:
board:
- 'PCBA-KNOT'
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Prepare image
uses: ./.github/actions/prepare-builder-image
with:
image-name: knot-electrical-builder
dockerfile: docker/electrical-builder/Dockerfile
- name: Run build
run: |
docker run --rm \
-v ${{ github.workspace }}:/work \
-w /work \
ghcr.io/${{ github.repository_owner }}/knot-electrical-builder:latest \
bash -c "make -C /work/Electrical/Design/${{ matrix.board }}"
- name: Fix file ownership
if: always()
run: sudo chown -R $USER ${{ github.workspace }}
- name: Print errors
if: always()
run: |
cat Electrical/Design/${{ matrix.board }}/mfg-bot/${{ matrix.board }}-drc.html
cat Electrical/Design/${{ matrix.board }}/kibot_error.log
- name: Set Date
run: echo "action_date=$(date +'%Y-%m-%d-%H%M')" >> $GITHUB_ENV
- name: Convert position file
run: |
python3 .github/workflows/convert_bottom_position.py ../../Electrical/Design/${{ matrix.board }}/mfg-bot/mfg/${{ matrix.board }}-both_pos.csv ../../Electrical/Design/${{ matrix.board }}/mfg-bot/mfg/${{ matrix.board }}-both_pos_fixed.csv
rm Electrical/Design/${{ matrix.board }}/mfg-bot/mfg/${{ matrix.board }}-both_pos.csv
- name: Zipping gerber
uses: vimtor/action-zip@v1
with:
files: Electrical/Design/${{ matrix.board }}/mfg-bot/JLCPCB
dest: Electrical/Design/${{ matrix.board }}/mfg-bot/mfg/${{ matrix.board }}-gerber.zip
- name: Rename pdf files and removing non-zipped gerber files
run: |
mv Electrical/Design/${{ matrix.board }}/mfg-bot/${{ matrix.board }}-erc.html Electrical/Design/${{ matrix.board }}/mfg-bot/${{ matrix.board }}_erc.html
mv Electrical/Design/${{ matrix.board }}/mfg-bot/${{ matrix.board }}-drc.html Electrical/Design/${{ matrix.board }}/mfg-bot/${{ matrix.board }}_drc.html
mv Electrical/Design/${{ matrix.board }}/mfg-bot/Schematic.pdf Electrical/Design/${{ matrix.board }}/mfg-bot/${{ matrix.board }}_Schematic.pdf
mv Electrical/Design/${{ matrix.board }}/mfg-bot/PCB_Top.pdf Electrical/Design/${{ matrix.board }}/mfg-bot/${{ matrix.board }}_PCB_Top.pdf
mv Electrical/Design/${{ matrix.board }}/mfg-bot/PCB_Bottom.pdf Electrical/Design/${{ matrix.board }}/mfg-bot/${{ matrix.board }}_PCB_Bottom.pdf
mv Electrical/Design/${{ matrix.board }}/mfg-bot/kibot_errors.filter Electrical/Design/${{ matrix.board }}/mfg-bot/${{ matrix.board }}_kibot_errors.filter
mv Electrical/Design/${{ matrix.board }}/kibot_error.log Electrical/Design/${{ matrix.board }}/mfg-bot/${{ matrix.board }}_kibot_error.log
rm -r Electrical/Design/${{ matrix.board }}/mfg-bot/JLCPCB
- name: Upload results
if: always()
uses: actions/upload-artifact@v4
with:
name: "result_${{ matrix.board }}_${{ env.action_date }}"
path: |
Electrical/Design/${{ matrix.board }}/mfg-bot/
if-no-files-found: warn