-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
105 lines (87 loc) · 4.39 KB
/
electronics.yml
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
name: Export Electronics
on:
push:
pull_request:
jobs:
export-electronics:
name: Export Electronics
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up outputs directory
run: mkdir -p electronics/build/outputs
- name: Install dependencies
run: ./electronics/scripts/dependencies.sh
- name: Export JLCPCB fabrication files [view_base]
run: |
./electronics/scripts/export_jlcpcb.py --release-prefix releases/view_base/ electronics/view_base/view_base.kicad_pcb
cp -r electronics/build/view_base-jlc electronics/build/outputs
- name: Export PCB overview PDF [view_base]
run: |
./electronics/scripts/generate_pdf.py --release-prefix releases/view_base/ electronics/view_base/view_base.kicad_pcb
cp electronics/build/view_base-pcb-packet.pdf electronics/build/outputs
env:
PYTHONUNBUFFERED: 1
- name: Export JLCPCB fabrication files [view_screen]
run: |
./electronics/scripts/export_jlcpcb.py --release-prefix releases/view_screen/ electronics/view_screen/view_screen.kicad_pcb
cp -r electronics/build/view_screen-jlc electronics/build/outputs
- name: Export PCB overview PDF [view_screen]
run: |
./electronics/scripts/generate_pdf.py --release-prefix releases/view_screen/ electronics/view_screen/view_screen.kicad_pcb
cp electronics/build/view_screen-pcb-packet.pdf electronics/build/outputs
env:
PYTHONUNBUFFERED: 1
- name: Export artifacts (KiBot) [view_base]
uses: INTI-CMNB/KiBot@db2185ac51d83f729e632c38e23b2d9df7ccd460
with:
config: electronics/view_base/view_base.kibot.yml
dir: electronics/build/outputs
schema: 'electronics/view_base/view_base.kicad_sch'
board: 'electronics/view_base/view_base.kicad_pcb'
- name: Export artifacts (KiBot) [view_screen]
uses: INTI-CMNB/KiBot@db2185ac51d83f729e632c38e23b2d9df7ccd460
with:
config: electronics/view_screen/view_screen.kibot.yml
dir: electronics/build/outputs
schema: 'electronics/view_screen/view_screen.kicad_sch'
board: 'electronics/view_screen/view_screen.kicad_pcb'
- name: Update 3D artifacts [view_base]
# Need to chown files back to runner, as ownership gets set to root by the KiBot Actions
run: |
sudo chown runner:docker electronics/build/outputs/*
mv electronics/build/outputs/view_base-3D_top.png electronics/build/outputs/view_base-front-3d.png
./scripts/annotate_image.sh electronics/build/outputs/view_base-front-3d.png
mv electronics/build/outputs/view_base-3D_bottom.png electronics/build/outputs/view_base-back-3d.png
./scripts/annotate_image.sh electronics/build/outputs/view_base-back-3d.png
env:
PYTHONUNBUFFERED: 1
- name: Update 3D artifacts [view_screen]
# Need to chown files back to runner, as ownership gets set to root by the KiBot Actions
run: |
sudo chown runner:docker electronics/build/outputs/*
mv electronics/build/outputs/view_screen-3D_top.png electronics/build/outputs/view_screen-front-3d.png
./scripts/annotate_image.sh electronics/build/outputs/view_screen-front-3d.png
mv electronics/build/outputs/view_screen-3D_bottom.png electronics/build/outputs/view_screen-back-3d.png
./scripts/annotate_image.sh electronics/build/outputs/view_screen-back-3d.png
env:
PYTHONUNBUFFERED: 1
- name: Archive artifacts
uses: actions/upload-artifact@v2
if: always()
with:
name: electronics
path: |
electronics/build
- name: Configure AWS Credentials
if: github.event_name == 'push' && github.repository_owner == 'scottbez1'
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Sync artifacts to S3
if: github.event_name == 'push' && github.repository_owner == 'scottbez1'
run: |
aws s3 sync electronics/build/outputs s3://smartknob-artifacts/${GITHUB_REF#refs/heads/}/electronics --delete --cache-control max-age=0,no-cache