-
Notifications
You must be signed in to change notification settings - Fork 1
114 lines (92 loc) · 3.78 KB
/
compile-production-files.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
105
106
107
108
109
110
111
112
113
114
name: Compile production files
on:
workflow_dispatch:
push:
jobs:
# backpack-board-bundle:
# runs-on: ubuntu-latest
# # These are all the steps that generate the files.
# steps:
# # Check out the files
# - uses: actions/checkout@v3
# with:
# submodules: true
# # Install the zip command line tool to package up the output
# - name: Install zip
# uses: montudor/action-zip@v1
# # Zip all the documentation. Any files in the PCBWay, PDFs, Renders, and Schematic subfolder
# # are automatically included.
# - name: Zip project template
# run: zip -qq -r backpack-template.zip ./backpack-template/
# working-directory: .
# # Upload all the zip files to the release.
# - name: Upload release files
# uses: softprops/action-gh-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# files: backpack-template.zip
compile-production-files:
runs-on: ubuntu-latest
# needs: esphome-firmware-validation
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: KiCAD main config file (kicad_common.json)
run: |
sudo mkdir -p /github/home/.config/kicad/7.0/
sudo chown -R $(id -u):$(id -g) /github/home/.config/kicad/7.0/
jq -n '{"environment": {"vars": {
"SLIMC_3DMODELS":"'$PWD'/esp-stepper-servo/dependencies/kicad-libraries/slimc/3d-packages",
"ESPRESSIF_3DMODELS":"'$PWD'/esp-stepper-servo/dependencies/kicad-libraries/espressif-kicad-libraries/3d",
}}}' > /github/home/.config/kicad/7.0/kicad_common.json
- name: Generate full documentation
uses: INTI-CMNB/KiBot@v2_k7
with:
dir: .
config: .kibot/full-outputs.kibot.yaml
schema: electronics/driver-board.kicad_sch
board: electronics/driver-board.kicad_pcb
install3D: yes
- name: Fix file permissions for generated files
run: sudo chown -R $(id -u):$(id -g) ./exports
- name: Get current date and time
id: gitstamp
run: echo "::set-output name=datehash::$(git log -1 --format='%as')-$(git log -1 --pretty=format:%h)"
# TODO: dynamic expand all images with date and commit hash
# - name: Copy renders to static folder
# run: |
# set -e
# FONT=".github/artifacts/fonts/RobotoMono-Bold.ttf"
# set -v
# LABEL="`${{ steps.date.outputs.date }}`\n`git rev-parse --short HEAD`"
# convert -background black -fill white -pointsize 12 -font "$FONT" -size 300x36 label:"$LABEL" -bordercolor black -border 3 exports/renders/*.png +swap -append exports/renders/*.png
- name: Commit renders to static folder
run: |
mkdir -p static/images/
cp -r exports/renders/*.png static/images/
git config user.name github-actions
git config user.email github-actions@github.com
git add -f static/images
git commit -m "latest renders"
git push
- name: Archive project artifacts
uses: actions/upload-artifact@v3
with:
name: driver-board-${{ steps.gitstamp.outputs.datehash }}
if-no-files-found: error
path: |
# Documentations
exports/driver-board-schematic-*.pdf
exports/driver-board-pcb-layers-*.pdf
exports/datasheets
# Production files
exports/gerbers/*.zip
exports/driver-board-bom-*.csv
## Design report
exports/driver-board-design-report-*.csv
# driver-board-report.pdf
## Extras
exports/renders/*.png
exports/driver-board-*.step