-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (69 loc) · 2.28 KB
/
build-hardware.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
name: Build Hardware
on:
push: # Trigger for pushes.
branches:
- main
paths:
- hardware/**
- .github/workflows/build-hardware.yaml
pull_request: # Trigger for pull requests.
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch: # Allows for manual triggering.
inputs:
ref:
description: "The ref to build."
required: false
workflow_call: # Allows for another workflow to call this one.
inputs:
ref:
description: "The ref to build."
required: true
type: string
for-release:
description: "True if we should upload artifacts for a release."
default: false
type: boolean
# If another instance of this workflow is started for the same PR, cancel the
# old one. If a PR is updated and a new test run is started, the old test run
# will be cancelled automatically to conserve resources.
concurrency:
group: build-hardware-${{ inputs.ref || github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build Hardware
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}
- name: Install KiCad
uses: ./.github/workflows/install-kicad
- name: Install custom symbols and footprints
run: |
mkdir -p ~/.local/share/kicad/8.0
cp -a hardware/libraries/* ~/.local/share/kicad/8.0/
mkdir -p ~/.config/kicad/8.0
cp .github/workflows/*-lib-table ~/.config/kicad/8.0/
- name: Install Kode Mono font
run: |
wget https://github.com/isaozler/kode-mono/releases/download/1.206/kode-mono-fonts.zip
unzip kode-mono-fonts.zip
mkdir -p ~/.local/share/fonts
cp kode-mono-fonts/fonts/ttf/* ~/.local/share/fonts/
rm -rf kode-mono-fonts{,.zip}
- name: Generate fab outputs
run: |
cd hardware
./fab-jlcpcb.sh cart
./fab-jlcpcb.sh microcontroller
./fab-jlcpcb.sh sram-bank
./fab-jlcpcb.sh ethernet
- name: Upload fab outputs
uses: actions/upload-artifact@v4
if: inputs.for-release
with:
name: hardware
path: hardware/*-fab.zip
retention-days: 1